Repository: mesos Updated Branches: refs/heads/master 066069dde -> 1909a06e1
Fixed a flaky ping timeout test. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1909a06e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1909a06e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1909a06e Branch: refs/heads/master Commit: 1909a06e16f10483e99d96348d6f82c21c2ac9f8 Parents: 066069d Author: Benjamin Mahler <[email protected]> Authored: Tue Aug 5 14:42:12 2014 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Tue Aug 5 14:42:12 2014 -0700 ---------------------------------------------------------------------- src/tests/slave_tests.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/1909a06e/src/tests/slave_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp index 432d8a2..765d8ce 100644 --- a/src/tests/slave_tests.cpp +++ b/src/tests/slave_tests.cpp @@ -921,6 +921,11 @@ TEST_F(SlaveTest, PingTimeoutNoPings) AWAIT_READY(slaveRegisteredMessage); + // Ensure the slave processes the registration message and schedules + // the ping timeout, before we advance the clock. + Clock::pause(); + Clock::settle(); + // Advance to the ping timeout to trigger a re-detection and // re-registration. Future<Nothing> detected = FUTURE_DISPATCH(_, &Slave::detected); @@ -928,7 +933,6 @@ TEST_F(SlaveTest, PingTimeoutNoPings) Future<SlaveReregisteredMessage> slaveReregisteredMessage = FUTURE_PROTOBUF(SlaveReregisteredMessage(), _, _); - Clock::pause(); Clock::advance(slave::MASTER_PING_TIMEOUT); AWAIT_READY(detected);
