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 2016/02/11 01:38:13 UTC
[1/2] mesos git commit: Added missing test finalization.
Repository: mesos
Updated Branches:
refs/heads/master ac4d67349 -> 84c6b714d
Added missing test finalization.
Review: https://reviews.apache.org/r/43422/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/56f7e011
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/56f7e011
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/56f7e011
Branch: refs/heads/master
Commit: 56f7e011e925a0e96ae4d9f5e3641422d273624e
Parents: ac4d673
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Wed Feb 10 13:34:02 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 10 13:34:02 2016 -0800
----------------------------------------------------------------------
src/tests/master_quota_tests.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/56f7e011/src/tests/master_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp
index 2255fc2..11cb321 100644
--- a/src/tests/master_quota_tests.cpp
+++ b/src/tests/master_quota_tests.cpp
@@ -986,6 +986,15 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
EXPECT_EQ(ROLE2, receivedQuotaRequest.get().info.role());
EXPECT_EQ(quotaResources, receivedQuotaRequest.get().info.guarantee());
+ framework1.stop();
+ framework1.join();
+
+ framework2.stop();
+ framework2.join();
+
+ framework3.stop();
+ framework3.join();
+
Shutdown();
}
[2/2] mesos git commit: Fixed a flaky test in quota tests.
Posted by mp...@apache.org.
Fixed a flaky test in quota tests.
The `AvailableResourcesAfterRescinding` test became flaky after we
stopped offering unreserved resources beyond quota in
https://reviews.apache.org/r/42835. Hence the allocator offers
rescinded resources to `framework1` if an allocation happens before
the test finishes, which violates the expectation that `framework1`
receives resources only once. Since we do not really care about
allocations in this test but rather about rescinded resources, the
fix is just to ignore subsequent offers to `framework1`.
Review: https://reviews.apache.org/r/42908/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/84c6b714
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/84c6b714
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/84c6b714
Branch: refs/heads/master
Commit: 84c6b714dd5df836a7943493562683ed41f7f396
Parents: 56f7e01
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Wed Feb 10 13:38:29 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Feb 10 13:38:29 2016 -0800
----------------------------------------------------------------------
src/tests/master_quota_tests.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/84c6b714/src/tests/master_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp
index 11cb321..8357ec9 100644
--- a/src/tests/master_quota_tests.cpp
+++ b/src/tests/master_quota_tests.cpp
@@ -895,9 +895,12 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
Future<vector<Offer>> offers;
// Set expectations for the first offer and launch the framework.
+ // In this test we care about rescinded resources and not about
+ // following allocations, hence ignore any subsequent offers.
EXPECT_CALL(sched1, registered(&framework1, _, _));
EXPECT_CALL(sched1, resourceOffers(&framework1, _))
- .WillOnce(FutureArg<1>(&offers));
+ .WillOnce(FutureArg<1>(&offers))
+ .WillRepeatedly(Return());
framework1.start();
@@ -955,6 +958,14 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
EXPECT_CALL(sched1, offerRescinded(&framework1, _))
.Times(2);
+ // In this test we are not interested in which frameworks will be offered
+ // the rescinded resources.
+ EXPECT_CALL(sched2, resourceOffers(&framework2, _))
+ .WillRepeatedly(Return());
+
+ EXPECT_CALL(sched3, resourceOffers(&framework3, _))
+ .WillRepeatedly(Return());
+
// Send a quota request for the specified role.
Future<Quota> receivedQuotaRequest;
EXPECT_CALL(allocator, setQuota(Eq(ROLE2), _))