diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-04-09 23:06:42 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-04-09 23:06:42 +0000 |
commit | b54576ffe89b55c621bc89164cbd7d96e352db66 (patch) | |
tree | 4fd46baa5c01ef6815c54eada397684f659a2084 /test/bbackupd/testbbackupd.cpp | |
parent | 2b1f41112c007c1e01f9a575817f5104aa76784f (diff) |
Fix race conditions where backups happen too slowly and tests fail.
Diffstat (limited to 'test/bbackupd/testbbackupd.cpp')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 89c4d288..df767500 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -1755,7 +1755,7 @@ int test_bbackupd() return 1; } - test_run_bbstored(); + TEST_THAT(test_run_bbstored() == 0); cmd = BBACKUPD " " + bbackupd_args + " testfiles/bbackupd.conf"; @@ -2541,9 +2541,13 @@ int test_bbackupd() > 1024); } - // wait for backup daemon to do it's stuff, and compare again - wait_for_backup_operation("bbackupd to sync the changes"); + // wait long enough for new files to be old enough to backup + wait_for_operation(5, "new files to be old enough"); + + // wait for backup daemon to do it's stuff + sync_and_wait(); + // compare to make sure that it worked compareReturnValue = ::system(BBACKUPQUERY " -Wwarning " "-c testfiles/bbackupd.conf " "-l testfiles/query2.log " @@ -2994,10 +2998,13 @@ int test_bbackupd() TEST_THAT(TestFileExists("testfiles/TestDir1/tracked-1")); TEST_THAT(TestFileExists("testfiles/TestDir1/tracked-2")); - // back up both files + // wait for them to be old enough to back up wait_for_operation(5, "tracked files to be old enough"); - wait_for_backup_operation("bbackupd to sync the tracked files"); + + // back up both files + sync_and_wait(); + // compare to make sure that it worked compareReturnValue = ::system(BBACKUPQUERY " " "-c testfiles/bbackupd.conf " "-l testfiles/query3h.log " @@ -4039,6 +4046,7 @@ int test(int argc, const char *argv[]) if(r != 0) return r; r = test_run_bbstored(); + TEST_THAT(r == 0); if(r != 0) return r; r = test_bbackupd(); |