mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject [1/2] mesos git commit: Fixed flakiness in some of the tests using scheduler library.
Date Mon, 20 Jun 2016 04:39:17 GMT
Repository: mesos
Updated Branches:
  refs/heads/master ce4b30561 -> 7d27e3ace


Fixed flakiness in some of the tests using scheduler library.

These tests piggyback on the old `connected` future. If the new
connection to the master takes some time to setup, we might end
up sending a call to the master before the connection is set up
since the `connected` future is already set from the last
invocation. While this succeeds now, but this might show more
flakiness once MESOS-5359 is committed.

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


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

Branch: refs/heads/master
Commit: 04a3fbf5abef70dc123c48b706d27e88e55d73a2
Parents: ce4b305
Author: Anand Mazumdar <anand@apache.org>
Authored: Sun Jun 19 17:54:06 2016 -0700
Committer: Anand Mazumdar <anand@apache.org>
Committed: Sun Jun 19 17:54:06 2016 -0700

----------------------------------------------------------------------
 src/tests/http_fault_tolerance_tests.cpp | 15 +++++++++------
 src/tests/scheduler_tests.cpp            | 10 ++++++----
 2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/04a3fbf5/src/tests/http_fault_tolerance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/http_fault_tolerance_tests.cpp b/src/tests/http_fault_tolerance_tests.cpp
index baa0739..6cba0c6 100644
--- a/src/tests/http_fault_tolerance_tests.cpp
+++ b/src/tests/http_fault_tolerance_tests.cpp
@@ -428,15 +428,16 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverStatusUpdate)
 
   auto scheduler2 = std::make_shared<MockV1HTTPScheduler>();
 
+  Future<Nothing> connected2;
   EXPECT_CALL(*scheduler2, connected(_))
-    .WillOnce(FutureSatisfy(&connected))
+    .WillOnce(FutureSatisfy(&connected2))
     .WillRepeatedly(Return()); // Ignore future invocations.
 
   // Failover to another scheduler instance.
   scheduler::TestV1Mesos schedulerLibrary2(
       master.get()->pid, contentType, scheduler2);
 
-  AWAIT_READY(connected);
+  AWAIT_READY(connected2);
 
   // The previously connected scheduler instance should receive an
   // error/disconnected event.
@@ -596,15 +597,16 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverExecutorToFrameworkMessage)
 
   auto scheduler2 = std::make_shared<MockV1HTTPScheduler>();
 
+  Future<Nothing> connected2;
   EXPECT_CALL(*scheduler2, connected(_))
-    .WillOnce(FutureSatisfy(&connected))
+    .WillOnce(FutureSatisfy(&connected2))
     .WillRepeatedly(Return()); // Ignore future invocations.
 
   // Failover to another scheduler instance.
   scheduler::TestV1Mesos schedulerLibrary2(
       master.get()->pid, contentType, scheduler2);
 
-  AWAIT_READY(connected);
+  AWAIT_READY(connected2);
 
   // The previously connected scheduler instance should receive an
   // error/disconnected event.
@@ -768,15 +770,16 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverFrameworkToExecutorMessage)
 
   auto scheduler2 = std::make_shared<MockV1HTTPScheduler>();
 
+  Future<Nothing> connected2;
   EXPECT_CALL(*scheduler2, connected(_))
-    .WillOnce(FutureSatisfy(&connected))
+    .WillOnce(FutureSatisfy(&connected2))
     .WillRepeatedly(Return()); // Ignore future invocations.
 
   // Failover to another scheduler instance.
   scheduler::TestV1Mesos schedulerLibrary2(
       master.get()->pid, contentType, scheduler2);
 
-  AWAIT_READY(connected);
+  AWAIT_READY(connected2);
 
   // The previously connected scheduler instance should receive an
   // error/disconnected event.

http://git-wip-us.apache.org/repos/asf/mesos/blob/04a3fbf5/src/tests/scheduler_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index b183105..e890c21 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -185,14 +185,15 @@ TEST_P(SchedulerTest, SchedulerFailover)
 
   auto scheduler2 = std::make_shared<MockV1HTTPScheduler>();
 
+  Future<Nothing> connected2;
   EXPECT_CALL(*scheduler2, connected(_))
-    .WillOnce(FutureSatisfy(&connected))
+    .WillOnce(FutureSatisfy(&connected2))
     .WillRepeatedly(Return()); // Ignore future invocations.
 
   // Failover to another scheduler instance.
   scheduler::TestV1Mesos mesos2(master.get()->pid, contentType, scheduler2);
 
-  AWAIT_READY(connected);
+  AWAIT_READY(connected2);
 
   // The previously connected scheduler instance should receive an
   // error/disconnected event.
@@ -284,13 +285,14 @@ TEST_P(SchedulerTest, MasterFailover)
 
   AWAIT_READY(disconnected);
 
+  Future<Nothing> connected2;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected))
+    .WillOnce(FutureSatisfy(&connected2))
     .WillRepeatedly(Return()); // Ignore future invocations.
 
   detector->appoint(master.get()->pid);
 
-  AWAIT_READY(connected);
+  AWAIT_READY(connected2);
 
   EXPECT_CALL(*scheduler, subscribed(_, _))
     .WillOnce(FutureArg<1>(&subscribed));


Mime
View raw message