You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2017/10/23 21:25:47 UTC

mesos git commit: Fixed the flaky MasterTest.IgnoreOldAgentReregistration.

Repository: mesos
Updated Branches:
  refs/heads/master fc67bcbe3 -> 2268d6179


Fixed the flaky MasterTest.IgnoreOldAgentReregistration.

This test did not settle the clock before advancing it, which
meant that the call to delay had not yet occurred.

Also updated the test to avoid retries of the registration
message, which can lead the agent to think it is registered
after a detection event, although this shouldn't be an issue
for this test.

Review: https://reviews.apache.org/r/63224


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2268d617
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2268d617
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2268d617

Branch: refs/heads/master
Commit: 2268d61791d99d399cd2cfeed0d5eafaafdc2937
Parents: fc67bcb
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Oct 23 13:43:57 2017 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Mon Oct 23 14:25:34 2017 -0700

----------------------------------------------------------------------
 src/tests/master_tests.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2268d617/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index c6906a7..7f4a807 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -8068,24 +8068,27 @@ TEST_F(MasterTest, IgnoreOldAgentReregistration)
   Future<SlaveRegisteredMessage> slaveRegisteredMessage =
     FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
 
+  Clock::pause();
+
   StandaloneMasterDetector detector(master.get()->pid);
   slave::Flags slaveFlags = CreateSlaveFlags();
   Try<Owned<cluster::Slave>> slave = StartSlave(&detector, slaveFlags);
   ASSERT_SOME(slave);
 
+  Clock::settle();
+  Clock::advance(slaveFlags.registration_backoff_factor);
+
   AWAIT_READY(slaveRegisteredMessage);
 
   // Intercept the agent's `ReregisterSlaveMessage`.
   Future<ReregisterSlaveMessage> reregisterSlaveMessage =
     DROP_PROTOBUF(ReregisterSlaveMessage(), _, _);
 
-  Clock::pause();
-
   // Simulate a new master detected event on the slave,
   // so that the slave will attempt to re-register.
   detector.appoint(master.get()->pid);
 
-  Clock::advance(slaveFlags.authentication_backoff_factor);
+  Clock::settle();
   Clock::advance(slaveFlags.registration_backoff_factor);
 
   AWAIT_READY(reregisterSlaveMessage);