summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2017-05-22 21:54:06 +0100
committerChris Wilson <chris+github@qwirx.com>2017-06-18 11:11:52 +0100
commit3a3fc72cd3b3c98870028f6d968b9cde64341ccd (patch)
treeb3c5c958ac8c6f7a2018edfad1fbac5e090a9263
parent81e9aa6545f7f19124c9f5e88982b867d8732965 (diff)
Relax timings on test_changing_client_store_marker_pauses_daemon
Also increase test verbosity to help debug the test if it fails again. (cherry picked from commit 00c2127e9832591c248fa6eea05dfaf785b8380d)
-rw-r--r--test/bbackupd/testbbackupd.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 60ae4e89..7113880d 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -361,8 +361,8 @@ 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();
+ Logger::LevelGuard undo_log_level_change(console, console.GetLevel());
+ Logging::Tagger undo_program_name_change;
std::vector<std::string> args;
size_t last_arg_start = 0;
@@ -3748,35 +3748,35 @@ bool test_changing_client_store_marker_pauses_daemon()
// Test that there *are* differences still, i.e. that bbackupd
// didn't successfully run a backup during that time.
- BOX_TRACE("Compare starting, expecting differences");
+ BOX_INFO("Compare starting, expecting differences");
TEST_COMPARE(Compare_Different);
BOX_TRACE("Compare finished, expected differences");
// Wait out the expected delay in bbackupd. This is quite
// time-sensitive, so we use sub-second precision.
- box_time_t wait =
+ box_time_t wait =
SecondsToBoxTime(BACKUP_ERROR_DELAY_SHORTENED - 1) -
compare_time * 2;
- BOX_TRACE("Waiting for " << BOX_FORMAT_MICROSECONDS(wait) <<
- " (plus another compare taking " <<
- BOX_FORMAT_MICROSECONDS(compare_time) << ") until "
- "just before bbackupd recovers");
+ BOX_INFO("Waiting for " << BOX_FORMAT_MICROSECONDS(wait) << " "
+ "until just before bbackupd recovers");
ShortSleep(wait, true);
// bbackupd should not have recovered yet, so there should
// still be differences.
- BOX_TRACE("Compare starting, expecting differences");
+ BOX_INFO("Compare starting, expecting differences");
TEST_COMPARE(Compare_Different);
BOX_TRACE("Compare finished, expected differences");
- // Now wait for it to recover and finish a sync, and check
- // that the differences are gone (successful backup).
- wait = sync_time + SecondsToBoxTime(2);
- BOX_TRACE("Waiting for " << BOX_FORMAT_MICROSECONDS(wait) <<
+ // Now wait for it to recover and finish a sync, and check that
+ // the differences are gone (successful backup). Wait until ~2
+ // seconds after we expect the sync to have finished, to reduce
+ // the risk of random failure on AppVeyor when heavily loaded.
+ wait = sync_time + SecondsToBoxTime(6);
+ BOX_INFO("Waiting for " << BOX_FORMAT_MICROSECONDS(wait) <<
" until just after bbackupd recovers and finishes a sync");
ShortSleep(wait, true);
- BOX_TRACE("Compare starting, expecting no differences");
+ BOX_INFO("Compare starting, expecting no differences");
TEST_COMPARE(Compare_Same);
BOX_TRACE("Compare finished, expected no differences");
}