You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2017/10/17 00:44:31 UTC

[12/14] mesos git commit: Avoided periodic allocations in reservation refinement tests.

Avoided periodic allocations in reservation refinement tests.

Turn off periodic allocations to avoid the race between
`HierarchicalAllocator::updateAvailable()` and periodic allocations.

Review: https://reviews.apache.org/r/63014


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1d166439
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1d166439
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1d166439

Branch: refs/heads/master
Commit: 1d166439a7424ca41488efc7f7bff404543ee502
Parents: 3cd907a
Author: Alexander Rukletsov <al...@apache.org>
Authored: Sat Oct 14 18:00:21 2017 -0700
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Mon Oct 16 17:42:43 2017 -0700

----------------------------------------------------------------------
 src/tests/master_tests.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1d166439/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index cf17768..7c30f23 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -8057,6 +8057,15 @@ class MasterTestPrePostReservationRefinement
   : public MasterTest,
     public WithParamInterface<bool> {
 public:
+  virtual master::Flags CreateMasterFlags()
+  {
+    // Turn off periodic allocations to avoid the race between
+    // `HierarchicalAllocator::updateAvailable()` and periodic allocations.
+    master::Flags flags = MasterTest::CreateMasterFlags();
+    flags.allocation_interval = Seconds(1000);
+    return flags;
+  }
+
   Resources inboundResources(RepeatedPtrField<Resource> resources)
   {
     // If reservation refinement is enabled, inbound resources are already