summaryrefslogtreecommitdiff
path: root/test/bbackupd/testbbackupd.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-10 23:45:43 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-10 23:45:43 +0000
commitce782cf62fe3d74ba530200256385bc578b42fba (patch)
tree83af1cec4abdf909f052dd125dfd905ca6936f1d /test/bbackupd/testbbackupd.cpp
parentaa031c82841b4ea44b58dcfec7bf9fcbc76ee77c (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/testbbackupd.cpp')
-rw-r--r--test/bbackupd/testbbackupd.cpp9
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