----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42121/#review113827 -----------------------------------------------------------
3rdparty/libprocess/src/tests/metrics_tests.cpp (lines 280 - 283) <https://reviews.apache.org/r/42121/#comment174618> Just some thoughts: The downstream event you're waiting for is a call to `Clock::timer` with a duration of 2 seconds. You can presumably access the private clock variables `timers` and `timers_mutex` by declaring them in the test. (We do with for `openssl::reinitialize`.) If you do this, you'll probably need to loop and check for a specific time to be added (`Timeout::in(duration)`). To make the check deterministic, the clock should be paused (so that `Clock::now` stays constant), which it already is in the test. - Joseph Wu On Jan. 10, 2016, 12:33 p.m., Neil Conway wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42121/ > ----------------------------------------------------------- > > (Updated Jan. 10, 2016, 12:33 p.m.) > > > Review request for mesos, Ben Mahler and Joris Van Remoortere. > > > Repository: mesos > > > Description > ------- > > Using `Clock::settle()` does not provide the synchronization that > "MetricsTest.SnapshotTimeout" requires. Of course, using `os::sleep()` is not > right either, but at least it is more honest than using `Clock::settle()`. > > > Diffs > ----- > > 3rdparty/libprocess/src/tests/metrics_tests.cpp > b84dc8d858f58bc9f52b218b7153510417cf34c2 > > Diff: https://reviews.apache.org/r/42121/diff/ > > > Testing > ------- > > ./3rdparty/libprocess/libprocess-tests > --gtest_filter="MetricsTest.SnapshotTimeout" --gtest_repeat=2000 > --gtest_break_on_failure > > > Thanks, > > Neil Conway > >
