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 2015/02/10 21:44:23 UTC
mesos git commit: Renamed test allocator actions for consistency.
Repository: mesos
Updated Branches:
refs/heads/master c6361c556 -> 82ad111cc
Renamed test allocator actions for consistency.
Review: https://reviews.apache.org/r/29932
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/82ad111c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/82ad111c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/82ad111c
Branch: refs/heads/master
Commit: 82ad111cc7c2a03abefda56a3134254e2a345bd2
Parents: c6361c5
Author: Alexander Rukletsov <al...@mesosphere.io>
Authored: Tue Feb 10 11:12:54 2015 -0800
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Tue Feb 10 11:12:54 2015 -0800
----------------------------------------------------------------------
src/tests/master_allocator_tests.cpp | 32 ++++++++++-----------
src/tests/mesos.hpp | 48 +++++++++++++++----------------
2 files changed, 40 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/82ad111c/src/tests/master_allocator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_allocator_tests.cpp b/src/tests/master_allocator_tests.cpp
index cad8024..23a3ed3 100644
--- a/src/tests/master_allocator_tests.cpp
+++ b/src/tests/master_allocator_tests.cpp
@@ -177,7 +177,7 @@ TYPED_TEST(MasterAllocatorTest, ResourcesUnused)
Future<Nothing> recoverResources;
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(DoAll(InvokeResourcesRecovered(&this->allocator),
+ .WillOnce(DoAll(InvokeRecoverResources(&this->allocator),
FutureSatisfy(&recoverResources)));
EXPECT_CALL(exec, registered(_, _, _, _));
@@ -266,7 +266,7 @@ TYPED_TEST(MasterAllocatorTest, OutOfOrderDispatch)
&sched1, frameworkInfo1, master.get(), DEFAULT_CREDENTIAL);
EXPECT_CALL(this->allocator, addFramework(_, Eq(frameworkInfo1), _))
- .WillOnce(InvokeFrameworkAdded(&this->allocator));
+ .WillOnce(InvokeAddFramework(&this->allocator));
Future<FrameworkID> frameworkId1;
EXPECT_CALL(sched1, registered(_, _, _))
@@ -300,7 +300,7 @@ TYPED_TEST(MasterAllocatorTest, OutOfOrderDispatch)
Future<Nothing> removeFramework;
EXPECT_CALL(this->allocator, removeFramework(Eq(frameworkId1.get())))
- .WillOnce(DoAll(InvokeFrameworkRemoved(&this->allocator),
+ .WillOnce(DoAll(InvokeRemoveFramework(&this->allocator),
FutureSatisfy(&removeFramework)));
driver1.stop();
@@ -335,7 +335,7 @@ TYPED_TEST(MasterAllocatorTest, OutOfOrderDispatch)
&sched2, frameworkInfo2, master.get(), DEFAULT_CREDENTIAL);
EXPECT_CALL(this->allocator, addFramework(_, Eq(frameworkInfo2), _))
- .WillOnce(InvokeFrameworkAdded(&this->allocator));
+ .WillOnce(InvokeAddFramework(&this->allocator));
FrameworkID frameworkId2;
EXPECT_CALL(sched2, registered(_, _, _))
@@ -417,9 +417,9 @@ TYPED_TEST(MasterAllocatorTest, SchedulerFailover)
// We don't filter the unused resources to make sure that
// they get offered to the framework as soon as it fails over.
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(InvokeResourcesRecoveredWithFilters(&this->allocator, 0))
+ .WillOnce(InvokeRecoverResourcesWithFilters(&this->allocator, 0))
// For subsequent offers.
- .WillRepeatedly(InvokeResourcesRecoveredWithFilters(&this->allocator, 0));
+ .WillRepeatedly(InvokeRecoverResourcesWithFilters(&this->allocator, 0));
EXPECT_CALL(exec, registered(_, _, _, _));
@@ -440,7 +440,7 @@ TYPED_TEST(MasterAllocatorTest, SchedulerFailover)
Future<Nothing> deactivateFramework;
EXPECT_CALL(this->allocator, deactivateFramework(_))
- .WillOnce(DoAll(InvokeFrameworkDeactivated(&this->allocator),
+ .WillOnce(DoAll(InvokeDeactivateFramework(&this->allocator),
FutureSatisfy(&deactivateFramework)));
driver1.stop();
@@ -547,7 +547,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkExited)
// The framework does not use all the resources.
Future<Nothing> recoverResources;
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(DoAll(InvokeResourcesRecovered(&this->allocator),
+ .WillOnce(DoAll(InvokeRecoverResources(&this->allocator),
FutureSatisfy(&recoverResources)));
EXPECT_CALL(exec1, registered(_, _, _, _));
@@ -591,7 +591,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkExited)
// The framework 2 does not use all the resources.
Future<Nothing> recoverResources2;
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(DoAll(InvokeResourcesRecovered(&this->allocator),
+ .WillOnce(DoAll(InvokeRecoverResources(&this->allocator),
FutureSatisfy(&recoverResources2)));
EXPECT_CALL(exec2, registered(_, _, _, _));
@@ -670,7 +670,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveLost)
Future<Nothing> recoverResources;
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(DoAll(InvokeResourcesRecovered(&this->allocator),
+ .WillOnce(DoAll(InvokeRecoverResources(&this->allocator),
FutureSatisfy(&recoverResources)));
EXPECT_CALL(exec, registered(_, _, _, _));
@@ -701,7 +701,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveLost)
Future<Nothing> removeSlave;
EXPECT_CALL(this->allocator, removeSlave(_))
- .WillOnce(DoAll(InvokeSlaveRemoved(&this->allocator),
+ .WillOnce(DoAll(InvokeRemoveSlave(&this->allocator),
FutureSatisfy(&removeSlave)));
EXPECT_CALL(exec, shutdown(_))
@@ -793,8 +793,8 @@ TYPED_TEST(MasterAllocatorTest, SlaveAdded)
// immediately and will get combined with slave2's
// resources for a single offer.
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillOnce(InvokeResourcesRecoveredWithFilters(&this->allocator, 0.1))
- .WillRepeatedly(InvokeResourcesRecoveredWithFilters(&this->allocator, 0));
+ .WillOnce(InvokeRecoverResourcesWithFilters(&this->allocator, 0.1))
+ .WillRepeatedly(InvokeRecoverResourcesWithFilters(&this->allocator, 0));
EXPECT_CALL(exec, registered(_, _, _, _));
@@ -886,7 +886,7 @@ TYPED_TEST(MasterAllocatorTest, TaskFinished)
// aggregate them with the resources from the finished task.
Future<Nothing> recoverResources;
EXPECT_CALL(this->allocator, recoverResources(_, _, _, _))
- .WillRepeatedly(DoAll(InvokeResourcesRecovered(&this->allocator),
+ .WillRepeatedly(DoAll(InvokeRecoverResources(&this->allocator),
FutureSatisfy(&recoverResources)));
EXPECT_CALL(exec, registered(_, _, _, _));
@@ -1293,7 +1293,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkReregistersFirst)
Future<Nothing> addFramework;
EXPECT_CALL(allocator2, addFramework(_, _, _))
- .WillOnce(DoAll(InvokeFrameworkAdded(&allocator2),
+ .WillOnce(DoAll(InvokeAddFramework(&allocator2),
FutureSatisfy(&addFramework)));
EXPECT_CALL(sched, registered(&driver, _, _));
@@ -1406,7 +1406,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveReregistersFirst)
Future<Nothing> addSlave;
EXPECT_CALL(allocator2, addSlave(_, _, _, _))
- .WillOnce(DoAll(InvokeSlaveAdded(&allocator2),
+ .WillOnce(DoAll(InvokeAddSlave(&allocator2),
FutureSatisfy(&addSlave)));
Try<PID<Master> > master2 = this->StartMaster(&allocator2);
http://git-wip-us.apache.org/repos/asf/mesos/blob/82ad111c/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index 83a3699..77992ac 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -696,42 +696,42 @@ public:
.WillRepeatedly(DoDefault());
ON_CALL(*this, addFramework(_, _, _))
- .WillByDefault(InvokeFrameworkAdded(this));
+ .WillByDefault(InvokeAddFramework(this));
EXPECT_CALL(*this, addFramework(_, _, _))
.WillRepeatedly(DoDefault());
ON_CALL(*this, removeFramework(_))
- .WillByDefault(InvokeFrameworkRemoved(this));
+ .WillByDefault(InvokeRemoveFramework(this));
EXPECT_CALL(*this, removeFramework(_))
.WillRepeatedly(DoDefault());
ON_CALL(*this, activateFramework(_))
- .WillByDefault(InvokeFrameworkActivated(this));
+ .WillByDefault(InvokeActivateFramework(this));
EXPECT_CALL(*this, activateFramework(_))
.WillRepeatedly(DoDefault());
ON_CALL(*this, deactivateFramework(_))
- .WillByDefault(InvokeFrameworkDeactivated(this));
+ .WillByDefault(InvokeDeactivateFramework(this));
EXPECT_CALL(*this, deactivateFramework(_))
.WillRepeatedly(DoDefault());
ON_CALL(*this, addSlave(_, _, _, _))
- .WillByDefault(InvokeSlaveAdded(this));
+ .WillByDefault(InvokeAddSlave(this));
EXPECT_CALL(*this, addSlave(_, _, _, _))
.WillRepeatedly(DoDefault());
ON_CALL(*this, removeSlave(_))
- .WillByDefault(InvokeSlaveRemoved(this));
+ .WillByDefault(InvokeRemoveSlave(this));
EXPECT_CALL(*this, removeSlave(_))
.WillRepeatedly(DoDefault());
ON_CALL(*this, activateSlave(_))
- .WillByDefault(InvokeSlaveReactivated(this));
+ .WillByDefault(InvokeActivateSlave(this));
EXPECT_CALL(*this, activateSlave(_))
.WillRepeatedly(DoDefault());
ON_CALL(*this, deactivateSlave(_))
- .WillByDefault(InvokeSlaveDeactivated(this));
+ .WillByDefault(InvokeDeactivateSlave(this));
EXPECT_CALL(*this, deactivateSlave(_))
.WillRepeatedly(DoDefault());
@@ -741,7 +741,7 @@ public:
.WillRepeatedly(DoDefault());
ON_CALL(*this, requestResources(_, _))
- .WillByDefault(InvokeResourcesRequested(this));
+ .WillByDefault(InvokeRequestResources(this));
EXPECT_CALL(*this, requestResources(_, _))
.WillRepeatedly(DoDefault());
@@ -751,12 +751,12 @@ public:
.WillRepeatedly(DoDefault());
ON_CALL(*this, recoverResources(_, _, _, _))
- .WillByDefault(InvokeResourcesRecovered(this));
+ .WillByDefault(InvokeRecoverResources(this));
EXPECT_CALL(*this, recoverResources(_, _, _, _))
.WillRepeatedly(DoDefault());
ON_CALL(*this, reviveOffers(_))
- .WillByDefault(InvokeOffersRevived(this));
+ .WillByDefault(InvokeReviveOffers(this));
EXPECT_CALL(*this, reviveOffers(_))
.WillRepeatedly(DoDefault());
}
@@ -830,7 +830,7 @@ public:
// The following actions make up for the fact that DoDefault
// cannot be used inside a DoAll, for example:
// EXPECT_CALL(allocator, addFramework(_, _, _))
-// .WillOnce(DoAll(InvokeFrameworkAdded(&allocator),
+// .WillOnce(DoAll(InvokeAddFramework(&allocator),
// FutureSatisfy(&addFramework)));
ACTION_P(InvokeInitialize, allocator)
@@ -844,7 +844,7 @@ ACTION_P(InvokeInitialize, allocator)
}
-ACTION_P(InvokeFrameworkAdded, allocator)
+ACTION_P(InvokeAddFramework, allocator)
{
process::dispatch(
allocator->real,
@@ -855,7 +855,7 @@ ACTION_P(InvokeFrameworkAdded, allocator)
}
-ACTION_P(InvokeFrameworkRemoved, allocator)
+ACTION_P(InvokeRemoveFramework, allocator)
{
process::dispatch(
allocator->real,
@@ -863,7 +863,7 @@ ACTION_P(InvokeFrameworkRemoved, allocator)
}
-ACTION_P(InvokeFrameworkActivated, allocator)
+ACTION_P(InvokeActivateFramework, allocator)
{
process::dispatch(
allocator->real,
@@ -872,7 +872,7 @@ ACTION_P(InvokeFrameworkActivated, allocator)
}
-ACTION_P(InvokeFrameworkDeactivated, allocator)
+ACTION_P(InvokeDeactivateFramework, allocator)
{
process::dispatch(
allocator->real,
@@ -881,7 +881,7 @@ ACTION_P(InvokeFrameworkDeactivated, allocator)
}
-ACTION_P(InvokeSlaveAdded, allocator)
+ACTION_P(InvokeAddSlave, allocator)
{
process::dispatch(
allocator->real,
@@ -893,7 +893,7 @@ ACTION_P(InvokeSlaveAdded, allocator)
}
-ACTION_P(InvokeSlaveRemoved, allocator)
+ACTION_P(InvokeRemoveSlave, allocator)
{
process::dispatch(
allocator->real,
@@ -902,7 +902,7 @@ ACTION_P(InvokeSlaveRemoved, allocator)
}
-ACTION_P(InvokeSlaveReactivated, allocator)
+ACTION_P(InvokeActivateSlave, allocator)
{
process::dispatch(
allocator->real,
@@ -911,7 +911,7 @@ ACTION_P(InvokeSlaveReactivated, allocator)
}
-ACTION_P(InvokeSlaveDeactivated, allocator)
+ACTION_P(InvokeDeactivateSlave, allocator)
{
process::dispatch(
allocator->real,
@@ -929,7 +929,7 @@ ACTION_P(InvokeUpdateWhitelist, allocator)
}
-ACTION_P(InvokeResourcesRequested, allocator)
+ACTION_P(InvokeRequestResources, allocator)
{
process::dispatch(
allocator->real,
@@ -950,7 +950,7 @@ ACTION_P(InvokeUpdateAllocation, allocator)
}
-ACTION_P(InvokeResourcesRecovered, allocator)
+ACTION_P(InvokeRecoverResources, allocator)
{
process::dispatch(
allocator->real,
@@ -962,7 +962,7 @@ ACTION_P(InvokeResourcesRecovered, allocator)
}
-ACTION_P2(InvokeResourcesRecoveredWithFilters, allocator, timeout)
+ACTION_P2(InvokeRecoverResourcesWithFilters, allocator, timeout)
{
Filters filters;
filters.set_refuse_seconds(timeout);
@@ -977,7 +977,7 @@ ACTION_P2(InvokeResourcesRecoveredWithFilters, allocator, timeout)
}
-ACTION_P(InvokeOffersRevived, allocator)
+ACTION_P(InvokeReviveOffers, allocator)
{
process::dispatch(
allocator->real,