Updated Branches: refs/heads/bmahler_fixed_task_statuses [created] 923da0787
Fixed the flaky AllocatorTest.RoleTest. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/923da078 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/923da078 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/923da078 Branch: refs/heads/bmahler_fixed_task_statuses Commit: 923da07876b993f866c7089c3b0876752afb34d5 Parents: c52c8cc Author: Benjamin Mahler <[email protected]> Authored: Thu Dec 12 14:42:50 2013 -0800 Committer: Benjamin Mahler <[email protected]> Committed: Thu Dec 12 14:43:07 2013 -0800 ---------------------------------------------------------------------- src/tests/allocator_tests.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/923da078/src/tests/allocator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/allocator_tests.cpp b/src/tests/allocator_tests.cpp index 3f231e3..c9592d4 100644 --- a/src/tests/allocator_tests.cpp +++ b/src/tests/allocator_tests.cpp @@ -1683,22 +1683,30 @@ TYPED_TEST(AllocatorTest, RoleTest) EXPECT_CALL(sched2, registered(_, _, _)) .WillOnce(FutureSatisfy(®istered2)); - EXPECT_CALL(this->allocator, frameworkAdded(_, _, _)); + Future<Nothing> frameworkAdded; + EXPECT_CALL(this->allocator, frameworkAdded(_, _, _)) + .WillOnce(FutureSatisfy(&frameworkAdded)); driver2.start(); AWAIT_READY(registered2); + AWAIT_READY(frameworkAdded); // Shut everything down. + Future<Nothing> frameworkDeactivated; EXPECT_CALL(this->allocator, frameworkDeactivated(_)) - .Times(AtMost(1)); + .WillOnce(FutureSatisfy(&frameworkDeactivated)); + Future<Nothing> frameworkRemoved; EXPECT_CALL(this->allocator, frameworkRemoved(_)) - .Times(AtMost(1)); + .WillOnce(FutureSatisfy(&frameworkRemoved)); driver2.stop(); driver2.join(); + AWAIT_READY(frameworkDeactivated); + AWAIT_READY(frameworkRemoved); + driver1.stop(); driver1.join();
