MB-21140: Fix race in test_access_scanner_settings (gmtime_r) 51/68151/4
authorDave Rigby <daver@couchbase.com>
Fri, 23 Sep 2016 13:59:34 +0000 (14:59 +0100)
committerDave Rigby <daver@couchbase.com>
Fri, 30 Sep 2016 17:24:04 +0000 (17:24 +0000)
commitb534010564ef9ed6ae172308bb58f56e212bd4ea
tree1e8c4d9fa32a5027a133448f283c210b98964b27
parente585bd843cadc0356cdf40e0ec1534ee2f46bee7
MB-21140: Fix race in test_access_scanner_settings (gmtime_r)

When calculating access scanner adjusted time values, use the
thread-safe variant (gmtime_r) so the test doesn't conflict with the
ep_engine code.

Also use std::chrono to perform the time manipulaton (which handles
any modulus of minutes -> hours etc).

Change-Id: Icf8505e4ce465f382904934dcaa05527efc57454
Reviewed-on: http://review.couchbase.org/68151
Reviewed-by: Daniel Owen <owend@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/access_scanner.cc
tests/ep_testsuite.cc