Repository: mesos Updated Branches: refs/heads/1.4.x 315d04743 -> 35fcdd778
Fixed an allocator test to avoid using quota on a hierarchical role. Currently, hierarchical quota only supports setting quota for the top-level roles. Setting quota for non-top-level role is not supported. Review: https://reviews.apache.org/r/64321/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5adc12ec Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5adc12ec Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5adc12ec Branch: refs/heads/1.4.x Commit: 5adc12ec36308108f5a0129353093e0a8f6fb160 Parents: 315d047 Author: Meng Zhu <[email protected]> Authored: Mon Dec 4 19:24:33 2017 -0800 Committer: Benjamin Mahler <[email protected]> Committed: Wed May 2 16:43:12 2018 -0700 ---------------------------------------------------------------------- src/tests/hierarchical_allocator_tests.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/5adc12ec/src/tests/hierarchical_allocator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp index e68e39a..1f27af0 100644 --- a/src/tests/hierarchical_allocator_tests.cpp +++ b/src/tests/hierarchical_allocator_tests.cpp @@ -4588,8 +4588,7 @@ TEST_F(HierarchicalAllocatorTest, DisproportionateQuotaVsAllocation) // This test ensures that resources reserved to ancestor roles can be offered -// to their descendants. Since both quota and fair-share stages perform -// reservation allocations, we use a quota'd role to test both cases. +// to their descendants. TEST_F(HierarchicalAllocatorTest, OfferAncestorReservationsToDescendantChild) { // Pausing the clock is not necessary, but ensures that the test @@ -4601,9 +4600,6 @@ TEST_F(HierarchicalAllocatorTest, OfferAncestorReservationsToDescendantChild) initialize(); - const Quota quota = createQuota(ROLE, "cpus:1;mem:512"); - allocator->setQuota(ROLE, quota); - FrameworkInfo framework = createFrameworkInfo({ROLE}); allocator->addFramework(framework.id(), framework, {}, true, {}); @@ -4617,8 +4613,7 @@ TEST_F(HierarchicalAllocatorTest, OfferAncestorReservationsToDescendantChild) {}); { - // All the resources of agent1 are offered, and this - // should satisfy the quota of ROLE. + // All the resources of agent1 are offered. Allocation expected = Allocation( framework.id(), {{ROLE, {{agent1.id(), agent1.resources()}}}}); @@ -4639,11 +4634,11 @@ TEST_F(HierarchicalAllocatorTest, OfferAncestorReservationsToDescendantChild) {}); { - // Since quota of ROLE is already satisfied by agent1, - // we expect only reserved resource of agent2 is offered. + // We expect all resources of agent2 including the reserved resources + // for the parent of ROLE will be offered. Allocation expected = Allocation( framework.id(), - {{ROLE, {{agent2.id(), Resources(agent2.resources()).reserved()}}}}); + {{ROLE, {{agent2.id(), agent2.resources()}}}}); AWAIT_EXPECT_EQ(expected, allocations.get()); }
