[Box Backup-commit] COMMIT r3446 - box/trunk/test/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Sat Dec 6 19:03:06 GMT 2014


Author: chris
Date: 2014-12-06 19:03:06 +0000 (Sat, 06 Dec 2014)
New Revision: 3446

Modified:
   box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Fix test_changing_client_store_marker_pauses_daemon failing randomly.

The shorter delay on error, introduced recently to speed up test runs,
combined with a guess about how long bbackupd would take to run a backup
and discover that the client store marker had changed, meant that sometimes
the daemon would have discovered the problem, aborted, waited and run again
while the test was waiting for the first failure.

Synchronising with the running daemon using bbackupctl wait_for_sync_end
should make the test timing accurate enough. We also tighten the recovery
timing checks to make sure that it's doing what it should.



Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2014-12-06 18:27:03 UTC (rev 3445)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2014-12-06 19:03:06 UTC (rev 3446)
@@ -3818,17 +3818,23 @@
 			::fclose(f);
 		}
 
-		// Wait a little bit longer than usual
-		wait_for_operation((TIME_TO_WAIT_FOR_BACKUP_OPERATION * 
-			3) / 2, "bbackupd to detect changed store marker");
+		// Wait for bbackupd to detect the problem
+		wait_for_sync_end();
 
 		// Test that there *are* differences
 		TEST_COMPARE(Compare_Different);
-	
-		wait_for_operation(BACKUP_ERROR_DELAY_SHORTENED,
-			"bbackupd to recover");
 
-		// Then check it has backed up successfully.
+		// Wait out the expected delay in bbackupd	
+		wait_for_operation(BACKUP_ERROR_DELAY_SHORTENED - 1,
+			"just before bbackupd recovers");
+
+		// bbackupd should not have recovered yet, so there should
+		// still be differences.
+		TEST_COMPARE(Compare_Different);
+
+		// Now wait for it to recover and finish a sync, and check
+		// that the differences are gone (successful backup).
+		wait_for_operation(2, "bbackupd to recover");
 		TEST_COMPARE(Compare_Same);
 	}
 




More information about the Boxbackup-commit mailing list