From ce782cf62fe3d74ba530200256385bc578b42fba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 10 Dec 2014 23:45:43 +0000 Subject: 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. --- test/bbackupd/testbbackupd.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') 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 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 -- cgit v1.2.3