Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 295793 - [jobs] Failure in testYieldJobToJob in N20091120
Summary: [jobs] Failure in testYieldJobToJob in N20091120
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-21 23:08 EST by John Arthorne CLA
Modified: 2009-11-21 23:35 EST (History)
1 user (show)

See Also:


Attachments
Fixes two timing problems and switch to JUnit assert (62.11 KB, patch)
2009-11-21 23:32 EST, John Arthorne CLA
no flags Details | Diff
Fixes two timing problems and switch to JUnit assert (8.82 KB, patch)
2009-11-21 23:33 EST, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2009-11-21 23:08:51 EST
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Result is not ok: Status ERROR: org.eclipse.core.jobs code=2 An internal error occurred during: "Yielding". org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.tests.runtime.jobs.YieldTest.testYieldJobToJob(YieldTest.java:160)
Comment 1 John Arthorne CLA 2009-11-21 23:31:58 EST
This is a timing problem in the test itself. The yielding job asserts that the blocked job is already waiting when the yielding job starts to run. It's possible that the blocked job hasn't even been added to the wait queue yet at this point. The assertion isn't particularly important to the test - it also asserts that the blocked job has a null result which is a useful enough test. The same timing problem is found in YieldTest.testThreadRestored.

Also, this test was using runtime's Assert rather than JUnit's Assert, which resulted in the test showing up as an "error" rather than a "failure".
Comment 2 John Arthorne CLA 2009-11-21 23:32:49 EST
Created attachment 152794 [details]
Fixes two timing problems and switch to JUnit assert
Comment 3 John Arthorne CLA 2009-11-21 23:33:57 EST
Created attachment 152795 [details]
Fixes two timing problems and switch to JUnit assert

Previous was wrong patch.
Comment 4 John Arthorne CLA 2009-11-21 23:35:53 EST
Fixed in HEAD.