You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix race condition in RCPTestWorkbenchAdvisor with CountDownLatch synchronization
The flaky test was caused by a race condition in RCPTestWorkbenchAdvisor.java.
The test spawns 4 background threads during preStartup() that schedule async/sync
runnables on the display. However, there was no guarantee these runnables would
execute before postStartup() marked the workbench as "started" (by setting
started = true). This meant asyncWithDisplayAccess could still be null when
the test assertions ran, causing intermittent failures.
This change adds a CountDownLatch to ensure all 4 async/sync operations complete
before marking the workbench as started.
Key changes to RCPTestWorkbenchAdvisor.java:
- Added CountDownLatch field initialized as a constant with count of 4
- Added proper imports for CountDownLatch and TimeUnit
- Simplified Boolean assignments to use !isSTARTED() directly
- Added finally blocks in setupSyncDisplayThread() and setupAsyncDisplayThread()
to call asyncLatch.countDown()
- Modified postStartup() to await latch completion with 5-second timeout
- Replaced warning logs with AssertionError on timeout and RuntimeException
on interruption to ensure test failures are explicit
Also bumps version of org.eclipse.ui.tests.harness for 4.38 stream.
Fixes#1517
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments