Skip to content

Commit 4f05fe1

Browse files
committed
MB-21534: test_access_scanner - handle clock wraparound
test_access_scanner attempts to set the access log scanner runtime to two hours in the future; however it doesn't check for wraparound midnight. Change-Id: I2851331a31773fe32221f3cf266f770f1ebefbaf Reviewed-on: http://review.couchbase.org/69364 Reviewed-by: Trond Norbye <[email protected]> Tested-by: buildbot <[email protected]>
1 parent 93b5a26 commit 4f05fe1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/ep_testsuite.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,10 +2765,11 @@ static enum test_result test_access_scanner(ENGINE_HANDLE *h,
27652765
const time_t now = time(nullptr);
27662766
struct tm tm_now;
27672767
cb_gmtime_r(&now, &tm_now);
2768+
const auto two_hours_hence = (tm_now.tm_hour + 2) % 24;
27682769

27692770
set_param(h, h1, protocol_binary_engine_param_flush, "alog_task_time",
2770-
(std::to_string(tm_now.tm_hour + 2)).c_str());
2771-
wait_for_stat_to_be(h, h1, "ep_alog_task_time", tm_now.tm_hour + 2);
2771+
std::to_string(two_hours_hence).c_str());
2772+
wait_for_stat_to_be(h, h1, "ep_alog_task_time", two_hours_hence);
27722773

27732774
testHarness.reload_engine(&h, &h1,
27742775
testHarness.engine_path,

0 commit comments

Comments
 (0)