You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2016/03/24 09:43:22 UTC
[2/2] mesos git commit: Moved code around.
Moved code around.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/65c1450f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/65c1450f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/65c1450f
Branch: refs/heads/master
Commit: 65c1450f2e948234d4dd2670244bc0e792b86f03
Parents: 92dd4f2
Author: Adam B <ad...@mesosphere.io>
Authored: Thu Mar 24 00:31:30 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Thu Mar 24 00:31:30 2016 -0700
----------------------------------------------------------------------
src/tests/registrar_tests.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/65c1450f/src/tests/registrar_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/registrar_tests.cpp b/src/tests/registrar_tests.cpp
index 6f1ddf5..39caf9b 100644
--- a/src/tests/registrar_tests.cpp
+++ b/src/tests/registrar_tests.cpp
@@ -909,10 +909,6 @@ TEST_P(RegistrarTest, UpdateWeights)
double WEIGHT2 = 3.5;
{
- hashmap<string, double> weights;
- weights[ROLE1] = WEIGHT1;
- vector<WeightInfo> weightInfos = getWeightInfos(weights);
-
// Prepare the registrar.
Registrar registrar(flags, state);
Future<Registry> registry = registrar.recover(master);
@@ -920,17 +916,16 @@ TEST_P(RegistrarTest, UpdateWeights)
ASSERT_EQ(0, registry.get().weights_size());
- // Store the weight for 'ROLE1' without weight in registry before.
+ // Store the weight for 'ROLE1' previously without weight.
+ hashmap<string, double> weights;
+ weights[ROLE1] = WEIGHT1;
+ vector<WeightInfo> weightInfos = getWeightInfos(weights);
+
AWAIT_EQ(true, registrar.apply(
Owned<Operation>(new UpdateWeights(weightInfos))));
}
{
- hashmap<string, double> weights;
- weights[ROLE1] = UPDATED_WEIGHT1;
- weights[ROLE2] = WEIGHT2;
- vector<WeightInfo> weightInfos = getWeightInfos(weights);
-
Registrar registrar(flags, state);
Future<Registry> registry = registrar.recover(master);
AWAIT_READY(registry);
@@ -942,6 +937,11 @@ TEST_P(RegistrarTest, UpdateWeights)
ASSERT_EQ(WEIGHT1, registry.get().weights(0).info().weight());
// Change weight for 'ROLE1', and store the weight for 'ROLE2'.
+ hashmap<string, double> weights;
+ weights[ROLE1] = UPDATED_WEIGHT1;
+ weights[ROLE2] = WEIGHT2;
+ vector<WeightInfo> weightInfos = getWeightInfos(weights);
+
AWAIT_EQ(true, registrar.apply(
Owned<Operation>(new UpdateWeights(weightInfos))));
}