Repository: mesos Updated Branches: refs/heads/master b5ecabb15 -> 00d4fa0b1
Fixed Java V1 Framework unit test for macOS. Added a 500ms delay in the main thread to wait for the scheduler driver to stop before program termination in the Java V1 Framework unit test to avoid test failure under macOS. Review: https://reviews.apache.org/r/57798/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/63b66282 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/63b66282 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/63b66282 Branch: refs/heads/master Commit: 63b66282d5ef611c80f35a4c292f88d9a79609e6 Parents: b5ecabb Author: Chun-Hung Hsiao <[email protected]> Authored: Thu Mar 23 08:09:34 2017 -0700 Committer: Anand Mazumdar <[email protected]> Committed: Thu Mar 23 08:09:34 2017 -0700 ---------------------------------------------------------------------- src/examples/java/V1TestFramework.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/63b66282/src/examples/java/V1TestFramework.java ---------------------------------------------------------------------- diff --git a/src/examples/java/V1TestFramework.java b/src/examples/java/V1TestFramework.java index df352ff..d8bd5cf 100644 --- a/src/examples/java/V1TestFramework.java +++ b/src/examples/java/V1TestFramework.java @@ -379,6 +379,18 @@ public class V1TestFramework { lock.unlock(); } + // NOTE: Copied from src/examples/java/TestFramework.java: + // For this test to pass reliably on some platforms, this sleep is + // required to ensure that the SchedulerDriver teardown is complete + // before the JVM starts running native object destructors after + // System.exit() is called. 500ms proved successful in test runs, + // but on a heavily loaded machine it might not. + + // TODO(greg): Ideally, we would inspect the status of the driver + // and its associated tasks via the Java API and wait until their + // teardown is complete to exit. + Thread.sleep(500); + System.exit(0); }
