You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/09/12 23:41:21 UTC

git commit: Fixed flaky MasterTest.LaunchDuplicateOfferTest.

Repository: mesos
Updated Branches:
  refs/heads/master 9a25f5ef8 -> d6c1ef684


Fixed flaky MasterTest.LaunchDuplicateOfferTest.

A couple of races could occur in the "launch tasks on multiple offers"
tests where recovered resources from purposely-failed invocations turned
into a subsequent resource offer and oversaturated the expect's.

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


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

Branch: refs/heads/master
Commit: d6c1ef6842b70af068ba14896693266ed6067724
Parents: 9a25f5e
Author: Niklas Nielsen <ni...@qni.dk>
Authored: Fri Sep 12 14:40:54 2014 -0700
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Fri Sep 12 14:40:54 2014 -0700

----------------------------------------------------------------------
 src/tests/master_tests.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d6c1ef68/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 3d080b2..ff2b50f 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -1182,7 +1182,8 @@ TEST_F(MasterTest, LaunchCombinedOfferTest)
 
   Future<vector<Offer> > offers3;
   EXPECT_CALL(sched, resourceOffers(&driver, _))
-    .WillOnce(FutureArg<1>(&offers3));
+    .WillOnce(FutureArg<1>(&offers3))
+    .WillRepeatedly(Return()); // Ignore subsequent offers.
 
   // Kill 1st task.
   TaskID taskId1 = task1.task_id();
@@ -1275,7 +1276,8 @@ TEST_F(MasterTest, LaunchAcrossSlavesTest)
   // Test that offers cannot span multiple slaves.
   Future<vector<Offer> > offers2;
   EXPECT_CALL(sched, resourceOffers(&driver, _))
-    .WillOnce(FutureArg<1>(&offers2));
+    .WillOnce(FutureArg<1>(&offers2))
+    .WillRepeatedly(Return()); // Ignore subsequent offers.
 
   Try<PID<Slave> > slave2 = StartSlave(&containerizer, flags);
   ASSERT_SOME(slave2);
@@ -1353,7 +1355,8 @@ TEST_F(MasterTest, LaunchDuplicateOfferTest)
   // Kill 2nd task and get offer for full slave.
   Future<vector<Offer> > offers;
   EXPECT_CALL(sched, resourceOffers(&driver, _))
-    .WillOnce(FutureArg<1>(&offers));
+    .WillOnce(FutureArg<1>(&offers))
+    .WillRepeatedly(Return()); // Ignore subsequent offers.
 
   driver.start();