Repository: mesos
Updated Branches:
  refs/heads/master 348ec1a60 -> cece83f37


Fixed flakyness in MasterTest.RegistryGcByCount.

The test could fail on very slow hosts due to a timeout
in the agent waiting for the registration and a subsequent
re-sent `SlaveRegisteredMessage. See MESOS-8485.

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


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

Branch: refs/heads/master
Commit: cece83f37bea2ec3e78efeb5db4aea1bbaa4b8d5
Parents: 348ec1a
Author: Benno Evers <bev...@mesosphere.com>
Authored: Wed Mar 7 14:00:26 2018 +0100
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Wed Mar 7 14:00:26 2018 +0100

----------------------------------------------------------------------
 src/tests/master_tests.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cece83f3/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 8be43f3..24b7f57 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -8528,6 +8528,12 @@ TEST_F(MasterTest, RegistryGcByCount)
     AWAIT_EXPECT_RESPONSE_STATUS_EQ(process::http::OK().status, response);
   }
 
+  // Wait for outstanding messages to be dropped, for example if
+  // the `SlaveRegisteredMessage` was re-sent after a timeout.
+  Clock::pause();
+  Clock::settle();
+  Clock::resume();
+
   Future<SlaveRegisteredMessage> slaveRegisteredMessage2 =
     FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get()->pid, _);
 
@@ -8605,8 +8611,8 @@ TEST_F(MasterTest, RegistryGcByCount)
   AWAIT_READY(reconcileUpdate1);
   AWAIT_READY(reconcileUpdate2);
 
-  ASSERT_EQ(TASK_UNKNOWN, reconcileUpdate1->state());
-  ASSERT_EQ(TASK_GONE_BY_OPERATOR, reconcileUpdate2->state());
+  EXPECT_EQ(TASK_UNKNOWN, reconcileUpdate1->state());
+  EXPECT_EQ(TASK_GONE_BY_OPERATOR, reconcileUpdate2->state());
 }
 
 

Reply via email to