Skip to content

Commit ba1c86c

Browse files
vogellaclaude
andcommitted
Fix race condition by waiting for TRUE values instead of non-null
After merging the Phaser-based synchronization from PR eclipse-platform#3429, apply the critical fix: the processEventsUntil condition was checking if syncWithDisplayAccess and asyncWithDisplayAccess were not null, but the test expects these values to be TRUE. If the async operations executed after started=true is set, they would be set to FALSE (because !isSTARTED() would be false), causing the test to fail intermittently. Changed the condition to wait until both values are TRUE using Boolean.TRUE.equals() instead of just checking for null. This ensures the workbench only marks itself as started after the async operations have completed AND set the expected TRUE values, preventing the flaky test failures reported in eclipse-platform#1517. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent b4b70d7 commit ba1c86c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/RCPTestWorkbenchAdvisor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ public void postStartup() {
233233

234234
// Pump the event loop to ensure async runnables execute before marking as started
235235
// This prevents the original race condition where async variables might not be set yet
236-
// Wait until the variables that should be set during startup are actually set
237-
UITestUtil.processEventsUntil(() -> syncWithDisplayAccess != null && asyncWithDisplayAccess != null, 5000);
236+
// Wait until the variables that should be set during startup are actually set to TRUE
237+
UITestUtil.processEventsUntil(() -> Boolean.TRUE.equals(syncWithDisplayAccess) && Boolean.TRUE.equals(asyncWithDisplayAccess), 5000);
238238
// Process any remaining events to allow variables that should NOT be set during startup
239239
// to accidentally execute (to detect regression)
240240
UITestUtil.processEvents();

0 commit comments

Comments
 (0)