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/24 21:07:34 UTC

[1/2] mesos git commit: Speed up MasterMaintenanceTest.EnterMaintenanceMode.

Repository: mesos
Updated Branches:
  refs/heads/master 1e1e73744 -> d0625cef4


Speed up MasterMaintenanceTest.EnterMaintenanceMode.

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


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

Branch: refs/heads/master
Commit: 5d813d80364b7209957d09822ef123e061b6cea2
Parents: 1e1e737
Author: haosdent huang <ha...@gmail.com>
Authored: Wed Feb 24 11:16:25 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Feb 24 12:04:53 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/5d813d80/src/tests/master_maintenance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_maintenance_tests.cpp b/src/tests/master_maintenance_tests.cpp
index b98eede..3e7cd82 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -590,7 +590,8 @@ TEST_F(MasterMaintenanceTest, EnterMaintenanceMode)
 
   MockExecutor exec(DEFAULT_EXECUTOR_ID);
 
-  Try<PID<Slave>> slave = StartSlave(&exec);
+  slave::Flags slaveFlags = CreateSlaveFlags();
+  Try<PID<Slave>> slave = StartSlave(&exec, slaveFlags);
   ASSERT_SOME(slave);
 
   MockScheduler sched;
@@ -686,6 +687,11 @@ TEST_F(MasterMaintenanceTest, EnterMaintenanceMode)
   // Verify that the framework received the slave lost message.
   AWAIT_READY(slaveLost);
 
+  Clock::pause();
+  Clock::settle();
+  Clock::advance(slaveFlags.executor_shutdown_grace_period);
+  Clock::resume();
+
   // Wait on the agent to terminate so that it wipes out it's latest symlink.
   // This way when we launch a new agent it will register with a new agent id.
   wait(slave.get());


[2/2] mesos git commit: Speed up MasterMaintenanceTest.InverseOffers.

Posted by jo...@apache.org.
Speed up MasterMaintenanceTest.InverseOffers.

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


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

Branch: refs/heads/master
Commit: d0625cef4adeb2d2fa528b3993e1bdd76adf3350
Parents: 5d813d8
Author: haosdent huang <ha...@gmail.com>
Authored: Wed Feb 24 11:16:32 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Feb 24 12:05:02 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/d0625cef/src/tests/master_maintenance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_maintenance_tests.cpp b/src/tests/master_maintenance_tests.cpp
index 3e7cd82..c9e3828 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -1040,7 +1040,8 @@ TEST_F(MasterMaintenanceTest, MachineStatus)
 TEST_F(MasterMaintenanceTest, InverseOffers)
 {
   // Set up a master.
-  Try<PID<Master>> master = StartMaster();
+  master::Flags masterFlags = CreateMasterFlags();
+  Try<PID<Master>> master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
   MockExecutor exec(DEFAULT_EXECUTOR_ID);
@@ -1212,10 +1213,16 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
     mesos.send(call);
   }
 
+  Clock::pause();
+  Clock::settle();
+  Clock::advance(masterFlags.allocation_interval);
+
   // Expect another inverse offer.
   event = events.get();
   AWAIT_READY(event);
   EXPECT_EQ(Event::OFFERS, event.get().type());
+  Clock::resume();
+
   EXPECT_EQ(0, event.get().offers().offers().size());
   EXPECT_EQ(1, event.get().offers().inverse_offers().size());
   inverseOffer = event.get().offers().inverse_offers(0);
@@ -1261,10 +1268,16 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
     mesos.send(call);
   }
 
+  Clock::pause();
+  Clock::settle();
+  Clock::advance(masterFlags.allocation_interval);
+
   // Expect yet another inverse offer.
   event = events.get();
   AWAIT_READY(event);
   EXPECT_EQ(Event::OFFERS, event.get().type());
+  Clock::resume();
+
   EXPECT_EQ(0, event.get().offers().offers().size());
   EXPECT_EQ(1, event.get().offers().inverse_offers().size());