You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/10/23 19:24:01 UTC

mesos git commit: Fixed flaky SchedulerTest.Suppress.

Repository: mesos
Updated Branches:
  refs/heads/master e1b0e1257 -> c69cc2d82


Fixed flaky SchedulerTest.Suppress.

Root Cause: The reason is that the DECLINE call set filter as 1hr,
the Clock::advance set as 100m. A race condition is that both DECLINE
and SUPPRESS started up in different threads and the call Clock::advance
may be called before SUPPRESS finished. The clock advanced for 100m which
is greater than 1hr, this caused the allocator start to allocate resource
again and ASSERT_TRUE(event.isPending()) will be failed.

Solution: Make SUPPRESS call is finished before call Clock::advance

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


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

Branch: refs/heads/master
Commit: c69cc2d82a7a6e7d1d449f04d6753b335e0f743f
Parents: e1b0e12
Author: Guangya Liu <gy...@gmail.com>
Authored: Fri Oct 23 10:21:17 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Oct 23 10:23:44 2015 -0700

----------------------------------------------------------------------
 src/tests/scheduler_tests.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c69cc2d8/src/tests/scheduler_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index 7946cb4..0afeca3 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -1010,6 +1010,9 @@ TEST_P(SchedulerTest, Suppress)
     mesos.send(call);
   }
 
+  Future<Nothing> suppressOffers =
+    FUTURE_DISPATCH(_, &MesosAllocatorProcess::suppressOffers);
+
   {
     Call call;
     call.mutable_framework_id()->CopyFrom(id);
@@ -1018,9 +1021,14 @@ TEST_P(SchedulerTest, Suppress)
     mesos.send(call);
   }
 
+  AWAIT_READY(suppressOffers);
+
+  // Wait for allocator to finish executing 'suppressOffers()'.
+  Clock::pause();
+  Clock::settle();
+
   // No offers should be sent within 100 mins because the framework
   // suppressed offers.
-  Clock::pause();
   Clock::advance(Minutes(100));
   Clock::settle();