You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2015/12/02 19:41:53 UTC
mesos git commit: Fixed flaky test
(AvailableResourcesAfterRescinding).
Repository: mesos
Updated Branches:
refs/heads/master 63a4de072 -> a5df87c63
Fixed flaky test (AvailableResourcesAfterRescinding).
Addendum to b2b0eedc7371cd294b715fc91312989919d57c7a
Review: https://reviews.apache.org/r/40818
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a5df87c6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a5df87c6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a5df87c6
Branch: refs/heads/master
Commit: a5df87c63c5bd6485e01ffe191e188b5ab8f5e52
Parents: 63a4de0
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Wed Dec 2 12:47:00 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Dec 2 13:41:43 2015 -0500
----------------------------------------------------------------------
src/tests/master_quota_tests.cpp | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a5df87c6/src/tests/master_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp
index 4812983..44e6f33 100644
--- a/src/tests/master_quota_tests.cpp
+++ b/src/tests/master_quota_tests.cpp
@@ -26,7 +26,6 @@
#include <mesos/quota/quota.hpp>
-#include <process/clock.hpp>
#include <process/future.hpp>
#include <process/http.hpp>
#include <process/id.hpp>
@@ -55,7 +54,6 @@ using mesos::internal::slave::Slave;
using mesos::quota::QuotaInfo;
-using process::Clock;
using process::Future;
using process::PID;
@@ -904,11 +902,8 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
AWAIT_READY(registered3);
// There should be no offers made to `framework2` and `framework3`
- // at this point since there are no free resources.
- EXPECT_CALL(sched2, resourceOffers(&framework2, _))
- .Times(0);
- EXPECT_CALL(sched3, resourceOffers(&framework3, _))
- .Times(0);
+ // after they are started, since there are no free resources. They
+ // may receive offers once we set the quota.
// Total cluster resources (3 identical agents): cpus=6, mem=3072.
// role1 share = 1 (cpus=6, mem=3072)
@@ -934,16 +929,6 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
.WillOnce(DoAll(InvokeSetQuota(&allocator),
FutureArg<1>(&receivedQuotaRequest)));
- // We pause the clock to avoid any further batch allocations.
- // `Clock::settle()` ensures that all pending allocations fire. When we
- // rescind offers, resources are recovered and become available for
- // allocation. This prevents a batch allocation from sneaking in right
- // after the rescind calls, allowing us to ensure that the expectation
- // we set above (that there will be no resource offers made to quota'ed
- // frameworks) is not violated.
- Clock::pause();
- Clock::settle();
-
Future<Response> response = process::http::post(
master.get(),
"quota",
@@ -963,9 +948,6 @@ TEST_F(MasterQuotaTest, AvailableResourcesAfterRescinding)
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response) << response.get().body;
- Clock::settle();
- Clock::resume();
-
// The quota request is granted and reached the allocator. Make sure nothing
// got lost in-between.
AWAIT_READY(receivedQuotaRequest);