summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-06 19:03:06 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-06 19:03:06 +0000
commit1795df04701ccc94d4bdeae9ad082f965aec1b12 (patch)
tree4ead5d7ed7d969b8736482a9e654538c9ba410fe /test/bbackupd
parent641a91592be221aa67e269aa276d7c8fefa1031e (diff)
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.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 6ea31bb3..fd35aee3 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -3818,17 +3818,23 @@ bool test_changing_client_store_marker_pauses_daemon()
::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);
}