Skip to content

Fix flaky ResourceInitialSelectionTest on macOS#3831

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:pr-3810asdf
Mar 31, 2026
Merged

Fix flaky ResourceInitialSelectionTest on macOS#3831
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:pr-3810asdf

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Mar 31, 2026

Summary

  • waitForDialogRefresh() previously waited for table.getItemCount() > 0 then slept a fixed 5×50ms (250ms) for the selection to be applied
  • FilteredItemsSelectionDialog runs two refresh cycles: one from FilterHistoryJob (history items only) and one from FilterJob (actual file results + selection applied)
  • On slower macOS CI runners, the first cycle could produce a temporarily non-zero count, the 250ms sleep expired before the second cycle finished, and the selection was checked before it was set
  • Fixed by replacing the fixed sleep with a DisplayHelper.waitForCondition that requires the item count to be stable (same value across two consecutive 10ms polls at non-zero), ensuring all RefreshJob cycles have settled before assertions run; timeout extended to 5s

Test plan

  • Run testSingleSelectionAndTwoInitialSelectionsWithInitialPattern repeatedly on macOS to verify no more intermittent failures
  • Run full ResourceInitialSelectionTest suite to confirm no regressions in tests that expect empty selection (they still work — the stability condition only exits once count is non-zero and stable)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Test Results

   852 files     852 suites   55m 43s ⏱️
 7 890 tests  7 647 ✅ 243 💤 0 ❌
20 172 runs  19 516 ✅ 656 💤 0 ❌

Results for commit f0626c8.

♻️ This comment has been updated with latest results.

@vogella vogella marked this pull request as ready for review March 31, 2026 09:20
… item count

The previous fix waited for table.getItemCount() > 0 then slept for a
fixed 5×50ms=250ms. This was unreliable because FilteredItemsSelectionDialog
runs two refresh cycles: the first (from FilterHistoryJob) can produce a
temporarily non-zero count with only history items before the initial
selection is applied, and the second (from FilterJob) populates the actual
results and applies the selection. On slower macOS CI runners the 250ms
sleep expired before the second refresh cycle completed.

Replace the fixed sleep with a condition-based wait that requires the item
count to be both non-zero and stable across consecutive polling checks
(DisplayHelper interval is 10ms). This ensures all RefreshJob cycles have
settled before selection state is inspected. Timeout is extended to 5s.
@vogella vogella mentioned this pull request Mar 31, 2026
3 tasks
@vogella vogella merged commit 06eb48d into eclipse-platform:master Mar 31, 2026
18 checks passed
@vogella vogella deleted the pr-3810asdf branch March 31, 2026 10:20
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.

1 participant