Bug 105821 - Job#join should allow passing a progress monitor
Summary: Job#join should allow passing a progress monitor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 4.5 M6   Edit
Assignee: Thirumala Reddy Mutchukota CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2005-08-02 12:30 EDT by Dirk Baeumer CLA
Modified: 2015-02-03 12:07 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-08-02 12:30:13 EDT
Like IJobManager#join the method on Job should allow passing a progress monitor
which is turned into blocked state.
Comment 1 Thirumala Reddy Mutchukota CLA 2014-12-03 21:06:18 EST
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.
Comment 2 John Arthorne CLA 2014-12-23 12:13:56 EST
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)
Comment 3 Thirumala Reddy Mutchukota CLA 2014-12-23 18:56:57 EST
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.
Comment 5 Szymon Ptaszkiewicz CLA 2015-02-02 12:22:36 EST
(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.
Comment 6 Sergey Prigogin CLA 2015-02-02 12:47:59 EST
(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.
Comment 7 Sergey Prigogin CLA 2015-02-03 12:07:48 EST
The merge leftovers have been removed from the code.