Bound the event queue drain in DisplayHelper - #4290
Open
vogella wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Bounds UI event draining and makes Quick Access provider queries cancellation-aware to prevent macOS test-harness hangs from exhausting the bundle timeout.
Changes:
- Caps event-queue draining at 500 ms.
- Replaces blocking
syncExecwith cancellable polling aroundasyncExec. - Uses the bounded helper when draining Quick Access render events.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
QuickAccessDialogTest.java |
Uses bounded event draining after computation. |
DisplayHelper.java |
Adds the event-queue drain limit. |
QuickAccessContents.java |
Makes UI-thread provider queries cancellation-aware. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
waitForCondition only re-checked its deadline after driveEventQueue returned, and driveEventQueue looped while readAndDispatch was true, so a display that never goes idle made the timeout unreachable. That is how a 60s wait in QuickAccessDialogTest.setUp consumed the whole 2h budget of org.eclipse.ui.tests on macOS. Cap one drain at 500ms. The Quick Access compute job could park for the same reason: its Display.syncExec from a job worker becomes pending work delivered by asyncExec, and SWT runs async messages only when nothing else was dispatched. Poll for the result instead, so a cancelled compute gives up rather than keeping COMPUTE_JOB_FAMILY non-empty forever. Addresses eclipse-platform#4289
vogella
force-pushed
the
issue-4289-bounded-event-loop
branch
from
August 28, 2026 11:50
104d8a1 to
9c00085
Compare
vogella
marked this pull request as ready for review
August 28, 2026 11:54
Contributor
Test Results 858 files ±0 858 suites ±0 52m 53s ⏱️ - 4m 51s For more details on these failures, see this check. Results for commit 9c00085. ± Comparison against base commit f0ef795. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The macOS
org.eclipse.ui.teststimeouts come from an unbounded event loop in the test harness:DisplayHelper.waitForConditiononly re-checks its deadline afterdriveEventQueuereturns, and that method loops whilereadAndDispatchis true. On a display that never goes idle the timeout is unreachable, which is how a 60s wait inQuickAccessDialogTest.setUpswallowed the whole 2h budget of the bundle. Capping one drain at 500ms turns the hang into a bounded, diagnosable failure while a healthy queue still drains completely.The Quick Access compute job could park for a related reason: its
Display.syncExecfrom a job worker becomes pending work delivered byasyncExec, and SWT only runs async messages when nothing else was dispatched in that iteration, soJob.cancel()could not free it. It now polls for the result and gives up on cancellation instead of leavingCOMPUTE_JOB_FAMILYnon-empty forever.This stops the bundle from consuming the harness budget; it does not by itself explain why the macOS display stops going idle, which still needs someone with a Mac to look at. Addresses #4289.