You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/02/25 08:33:06 UTC

mesos git commit: Fixed flakiness in MasterMaintenanceTest.InverseOffers.

Repository: mesos
Updated Branches:
  refs/heads/master d99c778de -> 82ff5ca90


Fixed flakiness in MasterMaintenanceTest.InverseOffers.

The accept/decline of the inverse offers in the test could arrive after
the clock is paused and advanced in the test.  This meant that the test
would trigger an allocation and then idle (because the clock is paused).
This is the same problem we fixed in
https://issues.apache.org/jira/browse/MESOS-4059 .

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


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

Branch: refs/heads/master
Commit: 82ff5ca906af52ce6ce509d14cc30c7c18ae576e
Parents: d99c778
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Wed Feb 24 23:15:56 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Feb 24 23:32:52 2016 -0800

----------------------------------------------------------------------
 src/tests/master_maintenance_tests.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/82ff5ca9/src/tests/master_maintenance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_maintenance_tests.cpp b/src/tests/master_maintenance_tests.cpp
index c9e3828..356015e 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -1196,6 +1196,12 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
     mesos.send(call);
   }
 
+  // To ensure that the decline call has reached the allocator before
+  // we advance the clock for the next batch allocation, we block on
+  // the appropriate allocator interface method being dispatched.
+  Future<Nothing> updateInverseOffer =
+    FUTURE_DISPATCH(_, &MesosAllocatorProcess::updateInverseOffer);
+
   {
     // Decline an inverse offer, with a filter.
     Call call;
@@ -1213,6 +1219,8 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
     mesos.send(call);
   }
 
+  AWAIT_READY(updateInverseOffer);
+
   Clock::pause();
   Clock::settle();
   Clock::advance(masterFlags.allocation_interval);
@@ -1251,6 +1259,9 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
       id,
       evolve(statuses.get().draining_machines(0).statuses(0).framework_id()));
 
+  updateInverseOffer =
+    FUTURE_DISPATCH(_, &MesosAllocatorProcess::updateInverseOffer);
+
   {
     // Accept an inverse offer, with filter.
     Call call;
@@ -1268,6 +1279,8 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
     mesos.send(call);
   }
 
+  AWAIT_READY(updateInverseOffer);
+
   Clock::pause();
   Clock::settle();
   Clock::advance(masterFlags.allocation_interval);