Commit 8ad3ee0
Fix flaky PartRenderingEngineTests.ensureCleanUpAddonCleansUp race condition
The test was failing intermittently with "CleanupAddon should ensure that
partStack is not rendered anymore, as all childs have been removed" because
it was checking the cleanup result before the async cleanup logic had a
chance to execute.
Root cause:
- CleanupAddon performs cleanup asynchronously via Display.asyncExec()
(CleanupAddon.java:352)
- When hidePart() is called, it triggers events that schedule async cleanup
tasks on the event queue
- The test was calling waitForCondition() immediately after hiding parts,
before the async cleanup tasks were even posted to the event queue
- This created a race where the wait could timeout before cleanup started
Fix:
- Add contextRule.spinEventLoop() after hiding partB and partC to ensure
async cleanup tasks are processed before waiting for the condition
- Wrap waitForCondition() in assertTrue() to fail immediately with a clear
message if cleanup doesn't complete within timeout
- Remove redundant assertFalse() statements
This matches the pattern used in the adjacent testBug332463 test which calls
spinEventLoop() after each hidePart() call.
Verified with 5 consecutive test runs - all passed (consistently completing
in ~0.028-0.036s).
Fixes #751
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 601b0d3 commit 8ad3ee0
File tree
1 file changed
+4
-5
lines changed- tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench
1 file changed
+4
-5
lines changedLines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2466 | 2466 | | |
2467 | 2467 | | |
2468 | 2468 | | |
2469 | | - | |
2470 | | - | |
2471 | | - | |
| 2469 | + | |
| 2470 | + | |
2472 | 2471 | | |
2473 | | - | |
2474 | | - | |
| 2472 | + | |
| 2473 | + | |
2475 | 2474 | | |
2476 | 2475 | | |
2477 | 2476 | | |
| |||
0 commit comments