Repository: mesos Updated Branches: refs/heads/master 5cc37c2cd -> b3d5857b8
Fixed 'SlaveRecoveryTest.RegisterDisconnectedSlave'. The test was broken in 'de11f0ffed36fbabc8fb4167859fd23b75f43f10' due to the executor sending one more status update. Additionally, an explicit verification of the status update acknowledgement was added to eliminate a common source of test flakyness. Review: https://reviews.apache.org/r/63177/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b3d5857b Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b3d5857b Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b3d5857b Branch: refs/heads/master Commit: b3d5857b800bc284918185bde336de60e62da5df Parents: 5cc37c2 Author: Benno Evers <bev...@mesosphere.com> Authored: Fri Oct 20 09:57:09 2017 -0700 Committer: Alexander Rukletsov <al...@apache.org> Committed: Fri Oct 20 09:57:09 2017 -0700 ---------------------------------------------------------------------- src/tests/slave_recovery_tests.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/b3d5857b/src/tests/slave_recovery_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp index c2d9cc8..db337ba 100644 --- a/src/tests/slave_recovery_tests.cpp +++ b/src/tests/slave_recovery_tests.cpp @@ -3354,16 +3354,28 @@ TYPED_TEST(SlaveRecoveryTest, RegisterDisconnectedSlave) Future<Message> registerExecutorMessage = FUTURE_MESSAGE(Eq(RegisterExecutorMessage().GetTypeName()), _, _); + Future<Nothing> startingStatus; Future<Nothing> runningStatus; EXPECT_CALL(sched, statusUpdate(_, _)) + .WillOnce(FutureSatisfy(&startingStatus)) .WillOnce(FutureSatisfy(&runningStatus)); + Future<Nothing> startingAck = + FUTURE_DISPATCH(_, &Slave::_statusUpdateAcknowledgement); + Future<Nothing> runningAck = + FUTURE_DISPATCH(_, &Slave::_statusUpdateAcknowledgement); + driver.launchTasks(offers.get()[0].id(), {task}); AWAIT_READY(registerExecutorMessage); - // Wait for TASK_RUNNING update. + // Wait for the acknowledgement of the TASK_RUNNING update + // to make sure the next sent status update is not a repeat + // of the unacknowledged TASK_RUNNING. + AWAIT_READY(startingStatus); + AWAIT_READY(startingAck); AWAIT_READY(runningStatus); + AWAIT_READY(runningAck); EXPECT_CALL(sched, slaveLost(_, _)) .Times(AtMost(1));