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

subversion at boxbackup.org subversion at boxbackup.org
Sat Jul 18 23:08:05 BST 2015


Author: chris
Date: 2015-07-18 22:08:04 +0000 (Sat, 18 Jul 2015)
New Revision: 3587

Modified:
   box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Fix test_backup_pauses_when_store_is_full by waiting for housekeeping.

It's not safe to assume that we can get into the store before housekeeping runs,
so don't try. Just wait for housekeeping to run and check that all the files are
deleted afterwards.

Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2015-07-01 19:40:41 UTC (rev 3586)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2015-07-18 22:08:04 UTC (rev 3587)
@@ -1821,10 +1821,15 @@
 		// But only once!
 		TEST_THAT(!TestFileExists("testfiles/notifyran.store-full.2"));
 
+		// We can't guarantee to get in before housekeeping runs, so it's safer
+		// (more reliable) to wait for it to finish.
+		wait_for_operation(5, "housekeeping to run");
+
 		// BLOCK
 		{
 			std::auto_ptr<BackupProtocolCallable> client =
-				connect_and_login(context, 0 /* read-write */);
+				connect_and_login(context,
+					BackupProtocolLogin::Flags_ReadOnly);
 			std::auto_ptr<BackupStoreDirectory> root_dir =
 				ReadDirectory(*client, BACKUPSTORE_ROOT_DIRECTORY_ID);
 
@@ -1851,13 +1856,12 @@
 			TEST_EQUAL(SearchDir(*d2_dir, "f6"), 0);
 			TEST_EQUAL(SearchDir(*d6_dir, "d8"), 0);
 
-			// But f1 and d7 should have been marked as deleted
-			// (but not actually deleted yet)
-			TEST_THAT(test_entry_deleted(*spacetest_dir, "f1"))
-			TEST_THAT(test_entry_deleted(*spacetest_dir, "d7"))
+			// But f1 and d7 should have been deleted.
+			TEST_EQUAL(SearchDir(*spacetest_dir, "f1"), 0);
+			TEST_EQUAL(SearchDir(*spacetest_dir, "d7"), 0);
 
-			TEST_THAT(check_num_files(4, 0, 1, 9));
-			TEST_THAT(check_num_blocks(*client, 8, 0, 2, 18, 28));
+			TEST_THAT(check_num_files(4, 0, 0, 8));
+			TEST_THAT(check_num_blocks(*client, 8, 0, 0, 16, 24));
 			client->QueryFinished();
 		}
 	}




More information about the Boxbackup-commit mailing list