You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/03/09 16:53:28 UTC
[1/5] mesos git commit: Minor cleanup for slave tests.
Repository: mesos
Updated Branches:
refs/heads/master 009963d9d -> eb08f0895
Minor cleanup for slave tests.
Review: https://reviews.apache.org/r/57162/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a0eb3794
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a0eb3794
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a0eb3794
Branch: refs/heads/master
Commit: a0eb3794805f0df7bd78baf4141704d33ea060f2
Parents: 009963d
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 9 11:47:17 2017 -0500
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu Mar 9 11:47:57 2017 -0500
----------------------------------------------------------------------
src/tests/slave_tests.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a0eb3794/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index ec2cd34..61f4f42 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2627,7 +2627,7 @@ TEST_F(SlaveTest, ContainerUpdatedBeforeTaskReachesExecutor)
EXPECT_CALL(sched, registered(_, _, _));
EXPECT_CALL(sched, resourceOffers(&driver, _))
- .WillOnce(LaunchTasks(DEFAULT_EXECUTOR_INFO, 1, "1", "128", "*"))
+ .WillOnce(LaunchTasks(DEFAULT_EXECUTOR_INFO, 1, 1, 128, "*"))
.WillRepeatedly(Return()); // Ignore subsequent offers.
// This is used to determine which of the following finishes first:
@@ -2685,7 +2685,7 @@ TEST_F(SlaveTest, TaskLaunchContainerizerUpdateFails)
EXPECT_CALL(sched, registered(_, _, _));
EXPECT_CALL(sched, resourceOffers(&driver, _))
- .WillOnce(LaunchTasks(DEFAULT_EXECUTOR_INFO, 1, "1", "128", "*"))
+ .WillOnce(LaunchTasks(DEFAULT_EXECUTOR_INFO, 1, 1, 128, "*"))
.WillRepeatedly(Return()); // Ignore subsequent offers.
// The executor may not receive the ExecutorRegisteredMessage if the
[5/5] mesos git commit: Simplified interface for setting weights in
allocator.
Posted by ne...@apache.org.
Simplified interface for setting weights in allocator.
Now that weights can change dynamically, passing a list of weights to
the allocator at initialization-time is unnecessary and confusing (e.g.,
the initial weights might be wrong, if a different set of weight values
are recovered from the registry).
Instead, require that weights are communicated to the allocator via the
existing `updateWeights` method.
Review: https://reviews.apache.org/r/56805/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/eb08f089
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/eb08f089
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/eb08f089
Branch: refs/heads/master
Commit: eb08f089574c8e57499872f9c16e8fd828cd355f
Parents: 2d7f284
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 9 11:47:27 2017 -0500
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu Mar 9 11:48:11 2017 -0500
----------------------------------------------------------------------
include/mesos/allocator/allocator.hpp | 8 ++-
src/master/allocator/mesos/allocator.hpp | 4 --
src/master/allocator/mesos/hierarchical.cpp | 2 -
src/master/allocator/mesos/hierarchical.hpp | 1 -
src/master/master.cpp | 56 +++++++-------------
src/tests/allocator.hpp | 9 ++--
src/tests/api_tests.cpp | 4 +-
src/tests/hierarchical_allocator_tests.cpp | 1 -
src/tests/master_allocator_tests.cpp | 34 ++++++------
src/tests/master_quota_tests.cpp | 20 +++----
src/tests/persistent_volume_endpoints_tests.cpp | 42 +++++++--------
src/tests/reservation_endpoints_tests.cpp | 40 +++++++-------
src/tests/reservation_tests.cpp | 8 +--
src/tests/resource_offers_tests.cpp | 2 +-
src/tests/slave_recovery_tests.cpp | 2 +-
15 files changed, 103 insertions(+), 130 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/include/mesos/allocator/allocator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/allocator/allocator.hpp b/include/mesos/allocator/allocator.hpp
index 25ed5f3..6eda1b8 100644
--- a/include/mesos/allocator/allocator.hpp
+++ b/include/mesos/allocator/allocator.hpp
@@ -81,8 +81,6 @@ public:
* to the frameworks.
* @param inverseOfferCallback A callback the allocator uses to send reclaim
* allocations from the frameworks.
- * @param weights Configured per-role weights. Any roles that do not
- * appear in this map will be assigned the default weight of 1.
*/
virtual void initialize(
const Duration& allocationInterval,
@@ -94,7 +92,6 @@ public:
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
inverseOfferCallback,
- const hashmap<std::string, double>& weights,
const Option<std::set<std::string>>&
fairnessExcludeResourceNames = None()) = 0;
@@ -415,8 +412,9 @@ public:
const std::string& role) = 0;
/**
- * Updates the weight of each provided role.
- * Subsequent allocation calculations will use these updated weights.
+ * Updates the weight associated with one or more roles. If a role
+ * was previously configured to have a weight and that role is
+ * omitted from this list, it keeps its old weight.
*/
virtual void updateWeights(
const std::vector<WeightInfo>& weightInfos) = 0;
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/master/allocator/mesos/allocator.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/allocator.hpp b/src/master/allocator/mesos/allocator.hpp
index 1defb59..57b54b8 100644
--- a/src/master/allocator/mesos/allocator.hpp
+++ b/src/master/allocator/mesos/allocator.hpp
@@ -56,7 +56,6 @@ public:
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
inverseOfferCallback,
- const hashmap<std::string, double>& weights,
const Option<std::set<std::string>>&
fairnessExcludeResourceNames = None());
@@ -193,7 +192,6 @@ public:
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
inverseOfferCallback,
- const hashmap<std::string, double>& weights,
const Option<std::set<std::string>>&
fairnessExcludeResourceNames = None()) = 0;
@@ -339,7 +337,6 @@ inline void MesosAllocator<AllocatorProcess>::initialize(
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
inverseOfferCallback,
- const hashmap<std::string, double>& weights,
const Option<std::set<std::string>>& fairnessExcludeResourceNames)
{
process::dispatch(
@@ -348,7 +345,6 @@ inline void MesosAllocator<AllocatorProcess>::initialize(
allocationInterval,
offerCallback,
inverseOfferCallback,
- weights,
fairnessExcludeResourceNames);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 0059cce..37fb7a6 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -141,13 +141,11 @@ void HierarchicalAllocatorProcess::initialize(
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
_inverseOfferCallback,
- const hashmap<string, double>& _weights,
const Option<set<string>>& _fairnessExcludeResourceNames)
{
allocationInterval = _allocationInterval;
offerCallback = _offerCallback;
inverseOfferCallback = _inverseOfferCallback;
- weights = _weights;
fairnessExcludeResourceNames = _fairnessExcludeResourceNames;
initialized = true;
paused = false;
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/master/allocator/mesos/hierarchical.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.hpp b/src/master/allocator/mesos/hierarchical.hpp
index 646f66e..f84b057 100644
--- a/src/master/allocator/mesos/hierarchical.hpp
+++ b/src/master/allocator/mesos/hierarchical.hpp
@@ -101,7 +101,6 @@ public:
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&
inverseOfferCallback,
- const hashmap<std::string, double>& weights,
const Option<std::set<std::string>>&
fairnessExcludeResourceNames = None());
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index dd1e4cd..d43350d 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -762,7 +762,6 @@ void Master::initialize()
flags.allocation_interval,
defer(self(), &Master::offer, lambda::_1, lambda::_2),
defer(self(), &Master::inverseOffer, lambda::_1, lambda::_2),
- weights,
flags.fair_sharing_excluded_resource_names);
// Parse the whitelist. Passing Allocator::updateWhitelist()
@@ -1761,51 +1760,34 @@ Future<Nothing> Master::_recover(const Registry& registry)
// satisfiable given all recovering agents reregister. We may want
// to notify operators early if total quota cannot be met.
- if (registry.weights_size() != 0) {
- vector<WeightInfo> weightInfos;
- hashmap<string, double> registry_weights;
-
- // Save the weights.
- foreach (const Registry::Weight& weight, registry.weights()) {
- registry_weights[weight.info().role()] = weight.info().weight();
- WeightInfo weightInfo;
- weightInfo.set_role(weight.info().role());
- weightInfo.set_weight(weight.info().weight());
- weightInfos.push_back(weightInfo);
- }
+ // Recover weights, and update the allocator accordingly. If we
+ // recovered weights from the registry, any weights specified on the
+ // command-line are ignored. If no weights were recovered from the
+ // registry, any weights specified on the command-line are used and
+ // then stored in the registry.
+ vector<WeightInfo> weightInfos;
+ if (registry.weights_size() != 0) {
// TODO(Yongqiao Wang): After the Mesos master quorum is achieved,
- // operator can send an update weights request to do a batch configuration
- // for weights, so the `--weights` flag can be deprecated and this check
- // can eventually be removed.
+ // operator can send an update weights request to do a batch
+ // configuration for weights, so the `--weights` flag can be
+ // deprecated and this check can eventually be removed.
if (!weights.empty()) {
LOG(WARNING) << "Ignoring --weights flag '" << flags.weights.get()
<< "' and recovering the weights from registry";
- // Before recovering weights from the registry, the allocator was already
- // initialized with `--weights`, so here we need to reset (to 1.0)
- // weights in the allocator that are not overridden by the registry.
- foreachkey (const string& role, weights) {
- if (!registry_weights.contains(role)) {
- WeightInfo weightInfo;
- weightInfo.set_role(role);
- weightInfo.set_weight(1.0);
- weightInfos.push_back(weightInfo);
- }
- }
+ weights.clear();
}
- // Recover `weights` with `registry_weights`.
- weights = registry_weights;
+ foreach (const Registry::Weight& weight, registry.weights()) {
+ WeightInfo weightInfo;
+ weightInfo.set_role(weight.info().role());
+ weightInfo.set_weight(weight.info().weight());
+ weightInfos.push_back(weightInfo);
- // Update allocator.
- allocator->updateWeights(weightInfos);
+ weights[weight.info().role()] = weight.info().weight();
+ }
} else if (!weights.empty()) {
- // The allocator was already updated with the `--weights` flag values
- // on startup.
- // Initialize the registry with `--weights` flag when bootstrapping
- // the cluster.
- vector<WeightInfo> weightInfos;
foreachpair (const string& role, double weight, weights) {
WeightInfo weightInfo;
weightInfo.set_role(role);
@@ -1815,6 +1797,8 @@ Future<Nothing> Master::_recover(const Registry& registry)
registrar->apply(Owned<Operation>(new weights::UpdateWeights(weightInfos)));
}
+ allocator->updateWeights(weightInfos);
+
// Recovery is now complete!
LOG(INFO) << "Recovered " << registry.slaves().slaves().size() << " agents"
<< " from the registry (" << Bytes(registry.ByteSize()) << ")"
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/allocator.hpp
----------------------------------------------------------------------
diff --git a/src/tests/allocator.hpp b/src/tests/allocator.hpp
index b6b0022..6b71c57 100644
--- a/src/tests/allocator.hpp
+++ b/src/tests/allocator.hpp
@@ -45,7 +45,7 @@ namespace tests {
ACTION_P(InvokeInitialize, allocator)
{
- allocator->real->initialize(arg0, arg1, arg2, arg3, arg4);
+ allocator->real->initialize(arg0, arg1, arg2, arg3);
}
@@ -229,9 +229,9 @@ public:
// to get the best of both worlds: the ability to use 'DoDefault'
// and no warnings when expectations are not explicit.
- ON_CALL(*this, initialize(_, _, _, _, _))
+ ON_CALL(*this, initialize(_, _, _, _))
.WillByDefault(InvokeInitialize(this));
- EXPECT_CALL(*this, initialize(_, _, _, _, _))
+ EXPECT_CALL(*this, initialize(_, _, _, _))
.WillRepeatedly(DoDefault());
ON_CALL(*this, recover(_, _))
@@ -357,7 +357,7 @@ public:
virtual ~TestAllocator() {}
- MOCK_METHOD5(initialize, void(
+ MOCK_METHOD4(initialize, void(
const Duration&,
const lambda::function<
void(const FrameworkID&,
@@ -365,7 +365,6 @@ public:
const lambda::function<
void(const FrameworkID&,
const hashmap<SlaveID, UnavailableResources>&)>&,
- const hashmap<std::string, double>&,
const Option<std::set<std::string>>&));
MOCK_METHOD2(recover, void(
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/api_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index fae24eb..08ad02e 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -933,7 +933,7 @@ TEST_P(MasterAPITest, ReserveResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Set a low allocation interval to speed up this test.
master::Flags flags = MesosTest::CreateMasterFlags();
@@ -1025,7 +1025,7 @@ TEST_P(MasterAPITest, UnreserveResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Set a low allocation interval to speed up this test.
master::Flags flags = MesosTest::CreateMasterFlags();
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/hierarchical_allocator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp
index cdf1f15..dce619e 100644
--- a/src/tests/hierarchical_allocator_tests.cpp
+++ b/src/tests/hierarchical_allocator_tests.cpp
@@ -180,7 +180,6 @@ protected:
flags.allocation_interval,
offerCallback.get(),
inverseOfferCallback.get(),
- {},
flags.fair_sharing_excluded_resource_names);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/master_allocator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_allocator_tests.cpp b/src/tests/master_allocator_tests.cpp
index 7b0b786..0fb66e4 100644
--- a/src/tests/master_allocator_tests.cpp
+++ b/src/tests/master_allocator_tests.cpp
@@ -164,7 +164,7 @@ TYPED_TEST(MasterAllocatorTest, SingleFramework)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -210,7 +210,7 @@ TYPED_TEST(MasterAllocatorTest, ResourcesUnused)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -317,7 +317,7 @@ TYPED_TEST(MasterAllocatorTest, OutOfOrderDispatch)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -445,7 +445,7 @@ TYPED_TEST(MasterAllocatorTest, SchedulerFailover)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -569,7 +569,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkExited)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.allocation_interval = Milliseconds(50);
@@ -717,7 +717,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveLost)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -841,7 +841,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveAdded)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.allocation_interval = Milliseconds(50);
@@ -937,7 +937,7 @@ TYPED_TEST(MasterAllocatorTest, TaskFinished)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.allocation_interval = Milliseconds(50);
@@ -1041,7 +1041,7 @@ TYPED_TEST(MasterAllocatorTest, CpusOnlyOfferedAndTaskLaunched)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.allocation_interval = Milliseconds(50);
@@ -1122,7 +1122,7 @@ TYPED_TEST(MasterAllocatorTest, MemoryOnlyOfferedAndTaskLaunched)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.allocation_interval = Milliseconds(50);
@@ -1216,7 +1216,7 @@ TYPED_TEST(MasterAllocatorTest, Whitelist)
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Future<Nothing> updateWhitelist1;
EXPECT_CALL(allocator, updateWhitelist(Option<hashset<string>>(hosts)))
@@ -1255,7 +1255,7 @@ TYPED_TEST(MasterAllocatorTest, RoleTest)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = this->CreateMasterFlags();
masterFlags.roles = Some("role2");
@@ -1348,7 +1348,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkReregistersFirst)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1405,7 +1405,7 @@ TYPED_TEST(MasterAllocatorTest, FrameworkReregistersFirst)
{
TestAllocator<TypeParam> allocator2;
- EXPECT_CALL(allocator2, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator2, initialize(_, _, _, _));
Future<Nothing> addFramework;
EXPECT_CALL(allocator2, addFramework(_, _, _, _))
@@ -1472,7 +1472,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveReregistersFirst)
{
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1528,7 +1528,7 @@ TYPED_TEST(MasterAllocatorTest, SlaveReregistersFirst)
{
TestAllocator<TypeParam> allocator2;
- EXPECT_CALL(allocator2, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator2, initialize(_, _, _, _));
Future<Nothing> addSlave;
EXPECT_CALL(allocator2, addSlave(_, _, _, _, _, _))
@@ -1595,7 +1595,7 @@ TYPED_TEST(MasterAllocatorTest, RebalancedForUpdatedWeights)
TestAllocator<TypeParam> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Start Mesos master.
master::Flags masterFlags = this->CreateMasterFlags();
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/master_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp
index e109656..e418f22 100644
--- a/src/tests/master_quota_tests.cpp
+++ b/src/tests/master_quota_tests.cpp
@@ -402,7 +402,7 @@ TEST_F(MasterQuotaTest, SetExistingQuota)
TEST_F(MasterQuotaTest, RemoveSingleQuota)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -571,7 +571,7 @@ TEST_F(MasterQuotaTest, Status)
TEST_F(MasterQuotaTest, InsufficientResourcesSingleAgent)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -633,7 +633,7 @@ TEST_F(MasterQuotaTest, InsufficientResourcesSingleAgent)
TEST_F(MasterQuotaTest, InsufficientResourcesMultipleAgents)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -710,7 +710,7 @@ TEST_F(MasterQuotaTest, InsufficientResourcesMultipleAgents)
TEST_F(MasterQuotaTest, AvailableResourcesSingleAgent)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -760,7 +760,7 @@ TEST_F(MasterQuotaTest, AvailableResourcesSingleAgent)
TEST_F(MasterQuotaTest, AvailableResourcesMultipleAgents)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -829,7 +829,7 @@ TEST_F(MasterQuotaTest, AvailableResourcesMultipleAgents)
TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1065,7 +1065,7 @@ TEST_F(MasterQuotaTest, RecoverQuotaEmptyCluster)
}
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Restart the master; configured quota should be recovered from the registry.
master->reset();
@@ -1099,7 +1099,7 @@ TEST_F(MasterQuotaTest, RecoverQuotaEmptyCluster)
TEST_F(MasterQuotaTest, NoAuthenticationNoAuthorization)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Disable http_readwrite authentication and authorization.
// TODO(alexr): Setting master `--acls` flag to `ACLs()` or `None()` seems
@@ -1209,7 +1209,7 @@ TEST_F(MasterQuotaTest, UnauthenticatedQuotaRequest)
TEST_F(MasterQuotaTest, AuthorizeGetUpdateQuotaRequests)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Setup ACLs so that only the default principal can modify quotas
// for `ROLE1` and read status.
@@ -1392,7 +1392,7 @@ TEST_F(MasterQuotaTest, AuthorizeGetUpdateQuotaRequests)
TEST_F(MasterQuotaTest, AuthorizeSetAndRemoveQuotaRequests)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
// Setup ACLs so that only the default principal can set and see
// quotas for `ROLE1` and can remove its own quotas.
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/persistent_volume_endpoints_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/persistent_volume_endpoints_tests.cpp b/src/tests/persistent_volume_endpoints_tests.cpp
index 34d569c..741d62e 100644
--- a/src/tests/persistent_volume_endpoints_tests.cpp
+++ b/src/tests/persistent_volume_endpoints_tests.cpp
@@ -116,7 +116,7 @@ TEST_F(PersistentVolumeEndpointsTest, StaticReservation)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -212,7 +212,7 @@ TEST_F(PersistentVolumeEndpointsTest, DynamicReservation)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -334,7 +334,7 @@ TEST_F(PersistentVolumeEndpointsTest, DynamicReservationRoleMismatch)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -416,7 +416,7 @@ TEST_F(PersistentVolumeEndpointsTest, UnreserveVolumeResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -481,7 +481,7 @@ TEST_F(PersistentVolumeEndpointsTest, InvalidVolume)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -549,7 +549,7 @@ TEST_F(PersistentVolumeEndpointsTest, VolumeExceedsReservedSize)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -591,7 +591,7 @@ TEST_F(PersistentVolumeEndpointsTest, DeleteNonExistentVolume)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -707,7 +707,7 @@ TEST_F(PersistentVolumeEndpointsTest, NoHeader)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -763,7 +763,7 @@ TEST_F(PersistentVolumeEndpointsTest, BadCredentials)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -839,7 +839,7 @@ TEST_F(PersistentVolumeEndpointsTest, GoodCreateAndDestroyACL)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -962,7 +962,7 @@ TEST_F(PersistentVolumeEndpointsTest, GoodCreateACLMultipleRoles)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1047,7 +1047,7 @@ TEST_F(PersistentVolumeEndpointsTest, BadCreateAndDestroyACL)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1176,7 +1176,7 @@ TEST_F(PersistentVolumeEndpointsTest, BadCreateACLMultipleRoles)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1266,7 +1266,7 @@ TEST_F(PersistentVolumeEndpointsTest, GoodCreateAndDestroyACLBadCredential)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1374,7 +1374,7 @@ TEST_F(PersistentVolumeEndpointsTest, NoAuthentication)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.authenticate_http_readwrite = false;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1433,7 +1433,7 @@ TEST_F(PersistentVolumeEndpointsTest, NoSlaveId)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1492,7 +1492,7 @@ TEST_F(PersistentVolumeEndpointsTest, NoVolumes)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1549,7 +1549,7 @@ TEST_F(PersistentVolumeEndpointsTest, OfferCreateThenEndpointRemove)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1709,7 +1709,7 @@ TEST_F(PersistentVolumeEndpointsTest, EndpointCreateThenOfferRemove)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1831,7 +1831,7 @@ TEST_F(PersistentVolumeEndpointsTest, ReserveAndSlaveRemoval)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1966,7 +1966,7 @@ TEST_F(PersistentVolumeEndpointsTest, SlavesEndpointFullResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/reservation_endpoints_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reservation_endpoints_tests.cpp b/src/tests/reservation_endpoints_tests.cpp
index 345f045..ddf279b 100644
--- a/src/tests/reservation_endpoints_tests.cpp
+++ b/src/tests/reservation_endpoints_tests.cpp
@@ -108,7 +108,7 @@ TEST_F(ReservationEndpointsTest, AvailableResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -207,7 +207,7 @@ TEST_F(ReservationEndpointsTest, ReserveOfferedResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -282,7 +282,7 @@ TEST_F(ReservationEndpointsTest, UnreserveOfferedResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -365,7 +365,7 @@ TEST_F(ReservationEndpointsTest, ReserveAvailableAndOfferedResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
master::Flags masterFlags = CreateMasterFlags();
// Turn off allocation. We're doing it manually.
@@ -523,7 +523,7 @@ TEST_F(ReservationEndpointsTest, UnreserveAvailableAndOfferedResources)
// Turn off allocation. We're doing it manually.
masterFlags.allocation_interval = Seconds(1000);
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -686,7 +686,7 @@ TEST_F(ReservationEndpointsTest, LabeledResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -847,7 +847,7 @@ TEST_F(ReservationEndpointsTest, InvalidResource)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -906,7 +906,7 @@ TEST_F(ReservationEndpointsTest, InsufficientResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -947,7 +947,7 @@ TEST_F(ReservationEndpointsTest, NoHeader)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -996,7 +996,7 @@ TEST_F(ReservationEndpointsTest, BadCredentials)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1065,7 +1065,7 @@ TEST_F(ReservationEndpointsTest, GoodReserveAndUnreserveACL)
masterFlags.allocation_interval = Milliseconds(50);
masterFlags.roles = frameworkInfo.role();
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1127,7 +1127,7 @@ TEST_F(ReservationEndpointsTest, GoodReserveACLMultipleRoles)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1188,7 +1188,7 @@ TEST_F(ReservationEndpointsTest, BadReserveACL)
masterFlags.allocation_interval = Milliseconds(50);
masterFlags.roles = frameworkInfo.role();
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1247,7 +1247,7 @@ TEST_F(ReservationEndpointsTest, BadUnreserveACL)
masterFlags.allocation_interval = Milliseconds(50);
masterFlags.roles = frameworkInfo.role();
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1320,7 +1320,7 @@ TEST_F(ReservationEndpointsTest, BadReserveACLMultipleRoles)
master::Flags masterFlags = CreateMasterFlags();
masterFlags.acls = acls;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1397,7 +1397,7 @@ TEST_F(ReservationEndpointsTest, NoResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1431,7 +1431,7 @@ TEST_F(ReservationEndpointsTest, NonMatchingPrincipal)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1477,7 +1477,7 @@ TEST_F(ReservationEndpointsTest, ReserveAndUnreserveNoAuthentication)
masterFlags.authenticate_frameworks = false;
masterFlags.authenticate_http_readwrite = false;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -1559,7 +1559,7 @@ TEST_F(ReservationEndpointsTest, DifferentPrincipalsSameRole)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
@@ -1640,7 +1640,7 @@ TEST_F(ReservationEndpointsTest, AgentStateEndpointResources)
{
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/reservation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reservation_tests.cpp b/src/tests/reservation_tests.cpp
index 5c0d014..95cc911 100644
--- a/src/tests/reservation_tests.cpp
+++ b/src/tests/reservation_tests.cpp
@@ -533,7 +533,7 @@ TEST_F(ReservationTest, DropReserveTooLarge)
masterFlags.allocation_interval = Milliseconds(5);
masterFlags.roles = frameworkInfo.role();
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -626,7 +626,7 @@ TEST_F(ReservationTest, DropReserveStaticReservation)
masterFlags.allocation_interval = Milliseconds(5);
masterFlags.roles = frameworkInfo.role();
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -2148,7 +2148,7 @@ TEST_F(ReservationTest, DropReserveWithInvalidRole)
masterFlags.allocation_interval = Milliseconds(5);
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
@@ -2246,7 +2246,7 @@ TEST_F(ReservationTest, PreventUnreservingAlienResources)
masterFlags.allocation_interval = Milliseconds(5);
TestAllocator<> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator, masterFlags);
ASSERT_SOME(master);
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/resource_offers_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/resource_offers_tests.cpp b/src/tests/resource_offers_tests.cpp
index 74dacf1..02fb248 100644
--- a/src/tests/resource_offers_tests.cpp
+++ b/src/tests/resource_offers_tests.cpp
@@ -285,7 +285,7 @@ TEST_F(ResourceOffersTest, Request)
{
TestAllocator<master::allocator::HierarchicalDRFAllocator> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = StartMaster(&allocator);
ASSERT_SOME(master);
http://git-wip-us.apache.org/repos/asf/mesos/blob/eb08f089/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index a836101..dc82db9 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -3115,7 +3115,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconcileTasksMissingFromSlave)
{
TestAllocator<master::allocator::HierarchicalDRFAllocator> allocator;
- EXPECT_CALL(allocator, initialize(_, _, _, _, _));
+ EXPECT_CALL(allocator, initialize(_, _, _, _));
Try<Owned<cluster::Master>> master = this->StartMaster(&allocator);
ASSERT_SOME(master);
[3/5] mesos git commit: Cleaned up header includes.
Posted by ne...@apache.org.
Cleaned up header includes.
Review: https://reviews.apache.org/r/57164/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e9cd7082
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e9cd7082
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e9cd7082
Branch: refs/heads/master
Commit: e9cd70821a79888ab7e30b9be4d54157f4d3ac58
Parents: d686f61
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 9 11:47:22 2017 -0500
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu Mar 9 11:48:05 2017 -0500
----------------------------------------------------------------------
include/mesos/roles.hpp | 2 ++
src/common/roles.cpp | 7 ++++++-
src/tests/reconciliation_tests.cpp | 3 ---
src/tests/slave_recovery_tests.cpp | 1 -
src/tests/sorter_tests.cpp | 3 ---
5 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e9cd7082/include/mesos/roles.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/roles.hpp b/include/mesos/roles.hpp
index 1e69544..9a74182 100644
--- a/include/mesos/roles.hpp
+++ b/include/mesos/roles.hpp
@@ -20,6 +20,8 @@
#include <string>
#include <vector>
+#include <stout/error.hpp>
+#include <stout/option.hpp>
#include <stout/try.hpp>
namespace mesos {
http://git-wip-us.apache.org/repos/asf/mesos/blob/e9cd7082/src/common/roles.cpp
----------------------------------------------------------------------
diff --git a/src/common/roles.cpp b/src/common/roles.cpp
index 31774a9..a53ac06 100644
--- a/src/common/roles.cpp
+++ b/src/common/roles.cpp
@@ -16,10 +16,15 @@
#include <mesos/roles.hpp>
+#include <vector>
+#include <string>
+
+#include <stout/error.hpp>
#include <stout/foreach.hpp>
+#include <stout/option.hpp>
#include <stout/strings.hpp>
+#include <stout/try.hpp>
-using std::initializer_list;
using std::string;
using std::vector;
http://git-wip-us.apache.org/repos/asf/mesos/blob/e9cd7082/src/tests/reconciliation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reconciliation_tests.cpp b/src/tests/reconciliation_tests.cpp
index 3573d55..b84a1ab 100644
--- a/src/tests/reconciliation_tests.cpp
+++ b/src/tests/reconciliation_tests.cpp
@@ -14,9 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <stdint.h>
-#include <unistd.h>
-
#include <vector>
#include <gmock/gmock.h>
http://git-wip-us.apache.org/repos/asf/mesos/blob/e9cd7082/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index a29b29c..a836101 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -14,7 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <stdint.h>
#include <unistd.h>
#include <string>
http://git-wip-us.apache.org/repos/asf/mesos/blob/e9cd7082/src/tests/sorter_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/sorter_tests.cpp b/src/tests/sorter_tests.cpp
index eaf2a26..ec0636b 100644
--- a/src/tests/sorter_tests.cpp
+++ b/src/tests/sorter_tests.cpp
@@ -14,9 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <stdarg.h>
-#include <stdint.h>
-
#include <iostream>
#include <string>
#include <vector>
[4/5] mesos git commit: Minor cleanup for quota validation code.
Posted by ne...@apache.org.
Minor cleanup for quota validation code.
Review: https://reviews.apache.org/r/57165/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2d7f2848
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2d7f2848
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2d7f2848
Branch: refs/heads/master
Commit: 2d7f284868b90cf9f36c39ede1af63970fde6f52
Parents: e9cd708
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 9 11:47:25 2017 -0500
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu Mar 9 11:48:08 2017 -0500
----------------------------------------------------------------------
src/master/quota.cpp | 24 +++++++++---------------
src/master/quota_handler.cpp | 2 +-
2 files changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/2d7f2848/src/master/quota.cpp
----------------------------------------------------------------------
diff --git a/src/master/quota.cpp b/src/master/quota.cpp
index 847ec06..3e0d280 100644
--- a/src/master/quota.cpp
+++ b/src/master/quota.cpp
@@ -110,15 +110,10 @@ Option<Error> quotaInfo(const QuotaInfo& quotaInfo)
return Error("QuotaInfo must specify a role");
}
- if (quotaInfo.role().empty()) {
- return Error("QuotaInfo must specify a non-empty role");
- }
-
// Check the provided role is valid.
Option<Error> roleError = roles::validate(quotaInfo.role());
if (roleError.isSome()) {
- return Error(
- "QuotaInfo with invalid role: " + roleError.get().message);
+ return Error("QuotaInfo with invalid role: " + roleError->message);
}
// Disallow quota for '*' role.
@@ -132,7 +127,7 @@ Option<Error> quotaInfo(const QuotaInfo& quotaInfo)
// only way that we offer non-revocable resources. Setting quota
// with an empty guarantee would mean the role is not entitled to
// get non-revocable offers.
- if (quotaInfo.guarantee().size() == 0) {
+ if (quotaInfo.guarantee().empty()) {
return Error("QuotaInfo with empty 'guarantee'");
}
@@ -141,25 +136,24 @@ Option<Error> quotaInfo(const QuotaInfo& quotaInfo)
Option<Error> resourceError = Resources::validate(resource);
if (resourceError.isSome()) {
return Error(
- "QuotaInfo with invalid resource: " + resourceError.get().message);
+ "QuotaInfo with invalid resource: " + resourceError->message);
}
- // Check that `resource` does not contain non-relevant fields for quota.
+ // Check that `resource` does not contain fields that are
+ // irrelevant for quota.
if (resource.has_reservation()) {
- return Error("QuotaInfo may not contain ReservationInfo");
+ return Error("QuotaInfo must not contain ReservationInfo");
}
if (resource.has_disk()) {
- return Error("QuotaInfo may not contain DiskInfo");
+ return Error("QuotaInfo must not contain DiskInfo");
}
if (resource.has_revocable()) {
- return Error("QuotaInfo may not contain RevocableInfo");
+ return Error("QuotaInfo must not contain RevocableInfo");
}
- // Check that the `Resource` is scalar.
if (resource.type() != Value::SCALAR) {
- return Error(
- "QuotaInfo may not include non-scalar resources");
+ return Error("QuotaInfo must not include non-scalar resources");
}
// Check that the role is either unset or default.
http://git-wip-us.apache.org/repos/asf/mesos/blob/2d7f2848/src/master/quota_handler.cpp
----------------------------------------------------------------------
diff --git a/src/master/quota_handler.cpp b/src/master/quota_handler.cpp
index ce1f064..36ea1ac 100644
--- a/src/master/quota_handler.cpp
+++ b/src/master/quota_handler.cpp
@@ -290,7 +290,7 @@ Future<QuotaStatus> Master::QuotaHandler::_status(
if (authorized) {
status.add_infos()->CopyFrom(*quotaInfoIt);
}
- ++quotaInfoIt;
+ ++quotaInfoIt;
}
return status;
[2/5] mesos git commit: Cleaned up sorter test cases.
Posted by ne...@apache.org.
Cleaned up sorter test cases.
Review: https://reviews.apache.org/r/57163/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d686f616
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d686f616
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d686f616
Branch: refs/heads/master
Commit: d686f616346f10ddf9d7840b59b23c680bb45c2c
Parents: a0eb379
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 9 11:47:20 2017 -0500
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu Mar 9 11:48:01 2017 -0500
----------------------------------------------------------------------
src/tests/sorter_tests.cpp | 30 +++++++-----------------------
1 file changed, 7 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d686f616/src/tests/sorter_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/sorter_tests.cpp b/src/tests/sorter_tests.cpp
index c93d236..eaf2a26 100644
--- a/src/tests/sorter_tests.cpp
+++ b/src/tests/sorter_tests.cpp
@@ -438,10 +438,7 @@ TEST(SorterTest, UpdateTotal)
sorter.allocated(
"b", slaveId, Resources::parse("cpus:1;mem:2").get());
- vector<string> sorted = sorter.sort();
- ASSERT_EQ(2u, sorted.size());
- EXPECT_EQ("b", sorted.front());
- EXPECT_EQ("a", sorted.back());
+ EXPECT_EQ(vector<string>({"b", "a"}), sorter.sort());
// Update the total resources by removing the previous total and
// adding back the new total.
@@ -450,10 +447,7 @@ TEST(SorterTest, UpdateTotal)
// Now the dominant share of "a" is 0.1 (mem) and "b" is 0.2 (mem),
// which should change the sort order.
- sorted = sorter.sort();
- ASSERT_EQ(2u, sorted.size());
- EXPECT_EQ("a", sorted.front());
- EXPECT_EQ("b", sorted.back());
+ EXPECT_EQ(vector<string>({"a", "b"}), sorter.sort());
}
@@ -483,10 +477,7 @@ TEST(SorterTest, MultipleSlavesUpdateTotal)
sorter.allocated(
"b", slaveB, Resources::parse("cpus:1;mem:3").get());
- vector<string> sorted = sorter.sort();
- ASSERT_EQ(2u, sorted.size());
- EXPECT_EQ("b", sorted.front());
- EXPECT_EQ("a", sorted.back());
+ EXPECT_EQ(vector<string>({"b", "a"}), sorter.sort());
// Update the total resources of slaveA by removing the previous
// total and adding the new total.
@@ -495,10 +486,7 @@ TEST(SorterTest, MultipleSlavesUpdateTotal)
// Now the dominant share of "a" is 0.02 (cpus) and "b" is 0.03
// (mem), which should change the sort order.
- sorted = sorter.sort();
- ASSERT_EQ(2u, sorted.size());
- EXPECT_EQ("a", sorted.front());
- EXPECT_EQ("b", sorted.back());
+ EXPECT_EQ(vector<string>({"a", "b"}), sorter.sort());
}
@@ -533,18 +521,14 @@ TEST(SorterTest, RevocableResources)
sorter.allocated("b", slaveId, b);
// Check that the allocations are correct.
- ASSERT_EQ(a, sorter.allocation("a", slaveId));
- ASSERT_EQ(b, sorter.allocation("b", slaveId));
+ EXPECT_EQ(a, sorter.allocation("a", slaveId));
+ EXPECT_EQ(b, sorter.allocation("b", slaveId));
// Check that the sort is correct.
- vector<string> sorted = sorter.sort();
- ASSERT_EQ(2u, sorted.size());
- EXPECT_EQ("a", sorted.front());
- EXPECT_EQ("b", sorted.back());
+ EXPECT_EQ(vector<string>({"a", "b"}), sorter.sort());
}
-
// This test verifies that shared resources are properly accounted for in
// the DRF sorter.
TEST(SorterTest, SharedResources)