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 2018/10/26 22:40:45 UTC
[mesos] branch master updated: Fixed flaky test
`SchedulerHttpApiTest.UpdatePidToHttpScheduler`.
This is an automated email from the ASF dual-hosted git repository.
josephwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 15b78fa Fixed flaky test `SchedulerHttpApiTest.UpdatePidToHttpScheduler`.
15b78fa is described below
commit 15b78fa5f4bd0968ecf168c32e8b6bbb0e822688
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Fri Oct 26 15:19:27 2018 -0700
Fixed flaky test `SchedulerHttpApiTest.UpdatePidToHttpScheduler`.
The test was flaky due to a race between scheduler driver stopping
during test teardown and the scheduler `error()` invocation.
Adding the missing synchronization for the expectation should
eliminate the race.
Review: https://reviews.apache.org/r/69176/
---
src/tests/scheduler_http_api_tests.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/tests/scheduler_http_api_tests.cpp b/src/tests/scheduler_http_api_tests.cpp
index 64c0006..d5b5eec 100644
--- a/src/tests/scheduler_http_api_tests.cpp
+++ b/src/tests/scheduler_http_api_tests.cpp
@@ -501,7 +501,9 @@ TEST_P(SchedulerHttpApiTest, UpdatePidToHttpScheduler)
Future<FrameworkErrorMessage> errorMessage =
FUTURE_PROTOBUF(FrameworkErrorMessage(), _, _);
- EXPECT_CALL(sched, error(_, _));
+ Future<Nothing> schedError;
+ EXPECT_CALL(sched, error(_, _))
+ .WillOnce(FutureSatisfy(&schedError));
driver.start();
@@ -560,6 +562,9 @@ TEST_P(SchedulerHttpApiTest, UpdatePidToHttpScheduler)
ASSERT_EQ(Event::HEARTBEAT, event->get().type());
+ AWAIT_READY(errorMessage);
+ AWAIT_READY(schedError);
+
driver.stop();
driver.join();
}