Repository: mesos Updated Branches: refs/heads/master ecdd58a5a -> a4b39beec
Fixes `FutureTest.After3` flakiness. Adds calls to `Clock::pause()`, `Clock::advance()` and `Clock::settle()` to `FutureTest.After3` therefore ensuring that data stored in timer's callbacks is destroyed by the time `Clock::settle()` returns. This is possible after a bug fix which caused timer's callbacks to not always be deleted before `Clock::settle()` returned. Review: https://reviews.apache.org/r/55576/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a4b39bee Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a4b39bee Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a4b39bee Branch: refs/heads/master Commit: a4b39beec9017d9c9dc8aa2a0bb39e1065e338e0 Parents: ecdd58a Author: Alexander Rojas <[email protected]> Authored: Tue Feb 28 10:46:40 2017 -0800 Committer: Benjamin Mahler <[email protected]> Committed: Tue Feb 28 10:46:40 2017 -0800 ---------------------------------------------------------------------- 3rdparty/libprocess/src/tests/future_tests.cpp | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/a4b39bee/3rdparty/libprocess/src/tests/future_tests.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/tests/future_tests.cpp b/3rdparty/libprocess/src/tests/future_tests.cpp index 380755f..2fc2bd4 100644 --- a/3rdparty/libprocess/src/tests/future_tests.cpp +++ b/3rdparty/libprocess/src/tests/future_tests.cpp @@ -269,6 +269,8 @@ TEST(FutureTest, After3) EXPECT_SOME(weak_future.get()); { + Clock::pause(); + // The original future disappears here. After this call the // original future goes out of scope and should not be reachable // anymore. @@ -278,6 +280,9 @@ TEST(FutureTest, After3) return Nothing(); }); + Clock::advance(Milliseconds(1)); + Clock::settle(); + AWAIT_READY(future); }
