diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-10 23:45:43 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-10 23:45:43 +0000 |
commit | ce782cf62fe3d74ba530200256385bc578b42fba (patch) | |
tree | 83af1cec4abdf909f052dd125dfd905ca6936f1d /test/bbackupd | |
parent | aa031c82841b4ea44b58dcfec7bf9fcbc76ee77c (diff) |
Fix timing issue causing test_changing_client_store_marker_pauses_daemon to fail.
We didn't take into account the time taken to perform a compare as part of
the test, when deciding how long to wait for bbackupd to recover.
Diffstat (limited to 'test/bbackupd')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 34928bfb..dcfbe57d 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -352,8 +352,10 @@ Daemon* spDaemon = NULL; bool configure_bbackupd(BackupDaemon& bbackupd, const std::string& config_file) { // Stop bbackupd initialisation from changing the console logging level + // and the program name tag. Logger& console(Logging::GetConsole()); Logger::LevelGuard guard(console, console.GetLevel()); + Logging::Tagger(); std::vector<std::string> args; size_t last_arg_start = 0; @@ -3823,12 +3825,15 @@ 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_COMPARE(Compare_Different); - // Wait out the expected delay in bbackupd - wait_for_operation(BACKUP_ERROR_DELAY_SHORTENED - 1, + // 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"); // bbackupd should not have recovered yet, so there should |