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

mesos git commit: Made the order of `EXPECT_CALL()`s match the expected order of events.

Repository: mesos
Updated Branches:
  refs/heads/master ffbed5ea3 -> 2bfdfc449


Made the order of `EXPECT_CALL()`s match the expected order of events.

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


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

Branch: refs/heads/master
Commit: 2bfdfc449185b99c2c933ff37a436b3dcdaffec7
Parents: ffbed5e
Author: Neil Conway <ne...@gmail.com>
Authored: Tue Dec 1 07:03:24 2015 -0500
Committer: Michael Park <mp...@apache.org>
Committed: Tue Dec 1 07:03:24 2015 -0500

----------------------------------------------------------------------
 src/tests/reservation_tests.cpp | 52 ++++++++++++++++++------------------
 1 file changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2bfdfc44/src/tests/reservation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reservation_tests.cpp b/src/tests/reservation_tests.cpp
index 15d180f..e7f1407 100644
--- a/src/tests/reservation_tests.cpp
+++ b/src/tests/reservation_tests.cpp
@@ -110,12 +110,12 @@ TEST_F(ReservationTest, ReserveThenUnreserve)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers));
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -202,12 +202,12 @@ TEST_F(ReservationTest, ReserveAndLaunchThenUnreserve)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers));
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -321,12 +321,12 @@ TEST_F(ReservationTest, ReserveShareWithinRole)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched1, registered(&driver1, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched1, resourceOffers(&driver1, _))
     .WillOnce(FutureArg<1>(&offers));
 
-  EXPECT_CALL(sched1, registered(&driver1, _, _));
-
   driver1.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -365,12 +365,12 @@ TEST_F(ReservationTest, ReserveShareWithinRole)
   // receive the resources.
   driver1.declineOffer(offer.id(), filtersForever);
 
+  EXPECT_CALL(sched2, registered(&driver2, _, _));
+
   // The expectation for the next offer.
   EXPECT_CALL(sched2, resourceOffers(&driver2, _))
     .WillOnce(FutureArg<1>(&offers));
 
-  EXPECT_CALL(sched2, registered(&driver2, _, _));
-
   driver2.start();
 
   // In the next offer, expect an offer with the resources reserved by
@@ -431,14 +431,14 @@ TEST_F(ReservationTest, DropReserveTooLarge)
   // We use this to capture the offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers));
 
   EXPECT_CALL(allocator, addFramework(_, _, _));
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -522,14 +522,14 @@ TEST_F(ReservationTest, DropReserveStaticReservation)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers));
 
   EXPECT_CALL(allocator, addFramework(_, _, _));
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with the statically reserved
@@ -610,13 +610,13 @@ TEST_F(ReservationTest, SendingCheckpointResourcesMessage)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect the sum of 'unreserved1' and
@@ -707,13 +707,13 @@ TEST_F(ReservationTest, ResourcesCheckpointing)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // Expect an offer with the unreserved resources.
@@ -798,13 +798,13 @@ TEST_F(ReservationTest, MasterFailover)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -843,12 +843,12 @@ TEST_F(ReservationTest, MasterFailover)
   Future<SlaveReregisteredMessage> slaveReregistered =
     FUTURE_PROTOBUF(SlaveReregisteredMessage(), _, _);
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the next offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers));
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   // Simulate a new master detected event on the slave so that the
   // slave will do a re-registration.
   detector.appoint(master2.get());
@@ -918,13 +918,13 @@ TEST_F(ReservationTest, CompatibleCheckpointedResources)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   // The expectation for the first offer.
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.
@@ -1034,12 +1034,12 @@ TEST_F(ReservationTest, CompatibleCheckpointedResourcesWithPersistentVolumes)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   AWAIT_READY(offers);
@@ -1149,12 +1149,12 @@ TEST_F(ReservationTest, IncompatibleCheckpointedResources)
   // We use this to capture offers from 'resourceOffers'.
   Future<vector<Offer>> offers;
 
+  EXPECT_CALL(sched, registered(&driver, _, _));
+
   EXPECT_CALL(sched, resourceOffers(&driver, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
-  EXPECT_CALL(sched, registered(&driver, _, _));
-
   driver.start();
 
   // In the first offer, expect an offer with unreserved resources.