summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-15 23:31:29 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-15 23:31:29 +0000
commit6c164aed556c99e51f7d3df91a195b2a4f2f1130 (patch)
tree073150b8373840f64cf9f308702fe46263ed612c /test/bbackupd
parent364a4dbd1203c346133d1f13ae70f1d2f343da94 (diff)
Fix test_changing_client_store_marker_pauses_daemon on NetBSD.
Running a compare takes far too long on NetBSD (3 seconds) and this was messing up the timing of the test.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index dcfbe57d..a8531e11 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -3768,6 +3768,16 @@ bool test_changing_client_store_marker_pauses_daemon()
SETUP_WITH_BBSTORED();
TEST_THAT(StartClient());
+ // Wait for the client to upload all current files.
+ wait_for_sync_end();
+
+ // Time how long a compare takes. On NetBSD it's 3 seconds, and that
+ // interferes with test timing unless we account for it.
+ int compare_start_time = time(NULL);
+ // There should be no differences right now (yet).
+ TEST_COMPARE(Compare_Same);
+ int compare_time = time(NULL) - compare_start_time;
+
// TODO FIXME dedent
{
// Then... connect to the server, and change the
@@ -3825,16 +3835,13 @@ bool test_changing_client_store_marker_pauses_daemon()
// Wait for bbackupd to detect the problem
wait_for_sync_end();
- int sync_end_time = time(NULL);
- // Test that there *are* differences
+ // Test that there *are* differences (still)
TEST_COMPARE(Compare_Different);
// Wait out the expected delay in bbackupd
- int current_time = time(NULL);
- wait_for_operation(sync_end_time - current_time +
- BACKUP_ERROR_DELAY_SHORTENED - 1,
- "just before bbackupd recovers");
+ wait_for_operation(BACKUP_ERROR_DELAY_SHORTENED - 1 -
+ compare_time * 2, "just before bbackupd recovers");
// bbackupd should not have recovered yet, so there should
// still be differences.