Fixed a test in MasterAuthorizationTest. - `MasterAuthorizationTest.PendingExecutorInfoDiffersOnDifferentSlaves` needs used to assume the mock authorizer is only called for tasks authorization but with the new `regsiter_agents` ACL this is no longer true.
Review: https://reviews.apache.org/r/57731 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/70ce5160 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/70ce5160 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/70ce5160 Branch: refs/heads/master Commit: 70ce51606731de0af03678f2bd3ddaf3d9d3627f Parents: 13d0591 Author: Jiang Yan Xu <[email protected]> Authored: Fri Mar 17 01:09:40 2017 -0700 Committer: Jiang Yan Xu <[email protected]> Committed: Fri Apr 28 14:55:13 2017 -0700 ---------------------------------------------------------------------- src/tests/master_authorization_tests.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/70ce5160/src/tests/master_authorization_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/master_authorization_tests.cpp b/src/tests/master_authorization_tests.cpp index a646768..e4233c1 100644 --- a/src/tests/master_authorization_tests.cpp +++ b/src/tests/master_authorization_tests.cpp @@ -884,11 +884,17 @@ TEST_F(MasterAuthorizationTest, PendingExecutorInfoDiffersOnDifferentSlaves) offers1.get()[0], executor1.command().value(), executor1.executor_id()); // Return a pending future from authorizer. + // Note that we retire this expectation after its use because + // the authorizer will next be called when `slave2` registers and + // this expectation would be hit again (and be oversaturated) if + // we don't retire. New expectations on `authorizer` will be set + // after `slave2` is registered. Future<Nothing> authorize; Promise<bool> promise; EXPECT_CALL(authorizer, authorized(_)) .WillOnce(DoAll(FutureSatisfy(&authorize), - Return(promise.future()))); + Return(promise.future()))) + .RetiresOnSaturation(); driver.launchTasks(offers1.get()[0].id(), {task1});
