You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2016/04/12 17:10:27 UTC

[04/10] mesos git commit: Speeded up MasterTest.MasterInfoOnReElection.

Speeded up MasterTest.MasterInfoOnReElection.

Advance the clock to trigger a batch allocation instantly.

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


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

Branch: refs/heads/master
Commit: f9a068d0c40b687f6120e4985b3d79a35def8acf
Parents: 2989e90
Author: haosdent huang <ha...@gmail.com>
Authored: Tue Apr 12 14:06:47 2016 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Tue Apr 12 14:58:26 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/f9a068d0/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 8deb7fc..09fb9ff 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -1006,7 +1006,8 @@ TEST_F(MasterTest, MasterInfo)
 
 TEST_F(MasterTest, MasterInfoOnReElection)
 {
-  Try<Owned<cluster::Master>> master = StartMaster();
+  master::Flags masterFlags = CreateMasterFlags();
+  Try<Owned<cluster::Master>> master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
   StandaloneMasterDetector detector(master.get()->pid);
@@ -1059,6 +1060,11 @@ TEST_F(MasterTest, MasterInfoOnReElection)
 
   EXPECT_EQ(MESOS_VERSION, masterInfo.get().version());
 
+  // Advance the clock and trigger a batch allocation.
+  Clock::pause();
+  Clock::advance(masterFlags.allocation_interval);
+  Clock::resume();
+
   // The re-registered framework should get offers.
   AWAIT_READY(resourceOffers2);