Community
Participate
Working Groups
Like IJobManager#join the method on Job should allow passing a progress monitor which is turned into blocked state.
Hi John, I pushed a patch to gerrit (https://git.eclipse.org/r/#/c/37529/) which adds support for Job#join with timeout and progress monitor. Please have a look at it and let me know your opinion. Thanks, Thirumal.
Hey Thirumala, thanks for the patch! Unfortunately there are a couple of issues: - The patch in gerrit conflicts with another change of yours that I just released. It needs manual rebasing - Two tests consistently fail when this patch is applied. Can you make sure all tests pass cleanly. I didn't have time to dig into the cause of the test failures: All Job Tests org.eclipse.core.tests.runtime.jobs.AllTests org.eclipse.core.tests.runtime.jobs.JobTest testJoinWithCancelingMonitor(org.eclipse.core.tests.runtime.jobs.JobTest) junit.framework.AssertionFailedError: Timeout after 50187ms waiting for status to change from START to DONE at junit.framework.Assert.fail(Assert.java:57) at junit.framework.Assert.assertTrue(Assert.java:22) at org.eclipse.core.tests.harness.TestBarrier.doWaitForStatus(TestBarrier.java:88) at org.eclipse.core.tests.harness.TestBarrier.waitForStatus(TestBarrier.java:122) at org.eclipse.core.tests.runtime.jobs.JobTest.testJoinWithCancelingMonitor(JobTest.java:934) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465) at org.eclipse.equinox.launcher.Main.main(Main.java:1438) testJoinWithProgressMonitor(org.eclipse.core.tests.runtime.jobs.JobTest) junit.framework.AssertionFailedError: Timeout after 10106ms waiting for status to change from START to DONE at junit.framework.Assert.fail(Assert.java:57) at junit.framework.Assert.assertTrue(Assert.java:22) at org.eclipse.core.tests.harness.TestBarrier.doWaitForStatus(TestBarrier.java:88) at org.eclipse.core.tests.harness.TestBarrier.waitForStatus(TestBarrier.java:114) at org.eclipse.core.tests.runtime.jobs.JobTest.testJoinWithProgressMonitor(JobTest.java:902) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:619) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465) at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Sorry for the test failures. I fixed them in the new patch set and now everything should be fine. Please have another look at it John.
The patch released as http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=23ce6cf36eba6244f6735ef39bfc3b3ceab03207
(In reply to Sergey Prigogin from comment #4) > The patch released as > http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/ > ?id=23ce6cf36eba6244f6735ef39bfc3b3ceab03207 This change hasn't been carefully reviewed. See the comment in Gerrit.
(In reply to Szymon Ptaszkiewicz from comment #5) > (In reply to Sergey Prigogin from comment #4) > > The patch released as > > http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/ > > ?id=23ce6cf36eba6244f6735ef39bfc3b3ceab03207 > > This change hasn't been carefully reviewed. See the comment in Gerrit. I've reviewed it.(In reply to Szymon Ptaszkiewicz from comment #5) > (In reply to Sergey Prigogin from comment #4) > > The patch released as > > http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/ > > ?id=23ce6cf36eba6244f6735ef39bfc3b3ceab03207 > > This change hasn't been carefully reviewed. See the comment in Gerrit. The change had been carefully reviewed prior to the sloppy merge, which unfortunately I didn't double-check in Gerrit.
The merge leftovers have been removed from the code.