MB-21034: Fix race in test_expiry_pager_settings (gmtime_r) 46/67946/5
authorDave Rigby <daver@couchbase.com>
Fri, 23 Sep 2016 13:59:34 +0000 (14:59 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 27 Sep 2016 18:22:58 +0000 (18:22 +0000)
commit05b2510b9d77d2f2f49b673b43312fc79879bdde
tree9a1d3d02e2da153460fc08ab22e224a1f9eb4168
parentd9811c84b94028865e747f5ba36f2427bdaaeed3
MB-21034: Fix race in test_expiry_pager_settings (gmtime_r)

When calculating expiry pager 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: Iee39a86b73a71642b9dab4ff2821d589699731ac
Reviewed-on: http://review.couchbase.org/67946
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/item_pager.cc
tests/ep_testsuite.cc