Repository: mesos Updated Branches: refs/heads/master 0a40243c6 -> 8ef59ed50
Fixed flakyness of MasterTest.UpdateSlaveMessageWithPendingOffers. Under rare circumstances, the clock would have to be advanced to trigger a new allocation cycle after 'UPDATE_SLAVE' has been handled in the master. We also wait for old offers to be rescinded before waiting for updated offers as sometimes the old offer could be received erroneously. Review: https://reviews.apache.org/r/65348/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8ef59ed5 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8ef59ed5 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8ef59ed5 Branch: refs/heads/master Commit: 8ef59ed50a8ce19383c7b52ad1dd6c1d93218021 Parents: 0a40243 Author: Jan Schlicht <j...@mesosphere.io> Authored: Mon Feb 12 14:01:04 2018 +0100 Committer: Benjamin Bannier <bbann...@apache.org> Committed: Mon Feb 12 14:01:04 2018 +0100 ---------------------------------------------------------------------- src/tests/master_tests.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/8ef59ed5/src/tests/master_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp index 76c86f8..28663c7 100644 --- a/src/tests/master_tests.cpp +++ b/src/tests/master_tests.cpp @@ -8612,9 +8612,7 @@ TEST_F(MasterTest, RegistryGcByCount) // that isn't motivated by (re-)registration (e.g. when adding // resources) is correctly handled by agent and master: Offers are // rescinded and new resources are offered. -// -// TODO(alexr): Enable after MESOS-8490 is resolved. -TEST_F(MasterTest, DISABLED_UpdateSlaveMessageWithPendingOffers) +TEST_F(MasterTest, UpdateSlaveMessageWithPendingOffers) { Clock::pause(); @@ -8718,7 +8716,9 @@ TEST_F(MasterTest, DISABLED_UpdateSlaveMessageWithPendingOffers) updateState->mutable_resource_version_uuid()->set_value( id::UUID::random().toBytes()); - EXPECT_CALL(*scheduler, rescind(_, _)); + Future<Nothing> rescinded; + EXPECT_CALL(*scheduler, rescind(_, _)) + .WillOnce(FutureSatisfy(&rescinded)); EXPECT_CALL(*scheduler, offers(_, _)) .WillOnce(FutureArg<1>(&offers)); @@ -8727,6 +8727,11 @@ TEST_F(MasterTest, DISABLED_UpdateSlaveMessageWithPendingOffers) AWAIT_READY(updateSlaveMessage); + AWAIT_READY(rescinded); + + Clock::advance(masterFlags.allocation_interval); + Clock::settle(); + AWAIT_READY(offers); ASSERT_FALSE(offers->offers().empty());