Skip to content

Bound the event queue drain in DisplayHelper - #4290

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:issue-4289-bounded-event-loop
Open

Bound the event queue drain in DisplayHelper#4290
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:issue-4289-bounded-event-loop

Conversation

@vogella

@vogella vogella commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The macOS org.eclipse.ui.tests timeouts come from an unbounded event loop in the test harness: DisplayHelper.waitForCondition only re-checks its deadline after driveEventQueue returns, and that method loops while readAndDispatch is true. On a display that never goes idle the timeout is unreachable, which is how a 60s wait in QuickAccessDialogTest.setUp swallowed 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.syncExec from a job worker becomes pending work delivered by asyncExec, and SWT only runs async messages when nothing else was dispatched in that iteration, so Job.cancel() could not free it. It now polls for the result and gives up on cancellation instead of leaving COMPUTE_JOB_FAMILY non-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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 syncExec with cancellable polling around asyncExec.
  • 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
vogella force-pushed the issue-4289-bounded-event-loop branch from 104d8a1 to 9c00085 Compare August 28, 2026 11:50
@vogella
vogella marked this pull request as ready for review August 28, 2026 11:54
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ±0     858 suites  ±0   52m 53s ⏱️ - 4m 51s
 8 174 tests ±0   7 930 ✅  - 1  243 💤 ±0  1 ❌ +1 
20 424 runs  ±0  19 767 ✅  - 1  656 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 9c00085. ± Comparison against base commit f0ef795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants