Skip to content

Ignore child popups in CompletionTest.findNewShell #3880 - #4491

Open
ravnskjaer wants to merge 2 commits into
eclipse-platform:masterfrom
ravnskjaer:completiontest-ignore-child-shells
Open

ravnskjaer wants to merge 2 commits into
eclipse-platform:masterfrom
ravnskjaer:completiontest-ignore-child-shells

Conversation

@ravnskjaer

@ravnskjaer ravnskjaer commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

testMoveCaretBackUsesAllProcessors_bug522255 sporadically fails with "More than one new shell was found" (on the macOS CI job of my fork; also reported on Windows in #3880).

Cause: When the UI thread is slow, the test's 200 ms wait can last longer than the post-selection delay (OpenStrategy.getPostSelectionDelay(), 500 ms). The additional proposal info popup (a child of the proposal popup) then opens next to the selected "Computing proposals" entry, and findNewShell counts it as a second shell. With temporary debug output listing the new shells (not part of this PR), the failure looked like this:

Expected at most one new shell, found 2:
- Shell ... bounds=Rectangle {318, 127, 286, 199}
    Table [Computing proposals (67%) ...] [rs are good for a beer.]
- Shell ... parent=Shell {} bounds=Rectangle {603, 127, 387, 199}
    StyledText '3 completion proposal processors requested.
2 completed; 1 pending.'
Proposal popup with Computing proposals selected and the additional proposal info popup next to it

Reproduced locally by extending the sleep(…, 200) before findNewShell in testMoveCaretBackUsesAllProcessors_bug522255 to 800 ms.

In the failures I saw, the failing iteration took noticeably longer than the passing ones (about 2 s instead of about 1 s), even though a failing iteration stops early.

Fix: findNewShell ignores new shells whose parent is another new shell. The test is also re-enabled on macOS (disabled since 2023 for #906): in ~300 iterations on the macOS CI job of my fork, this race was the only failure. The remaining four tests follow in a separate PR.

Verification: with the sleep at 800 ms, 50/50 iterations failed without the fix and 50/50 passed with it.

See #3880



The additional proposal info popup, a child of the proposal popup,
could be counted as a second new shell when the UI thread was delayed,
failing testMoveCaretBackUsesAllProcessors_bug522255. Count only
top-level shells.

Also re-enable testMoveCaretBackUsesAllProcessors_bug522255 on macOS,
where it was disabled for
eclipse-platform#906.

See eclipse-platform#3880
List<Shell> topLevelNewShells = newShells.stream()
.filter(shell -> !newShells.contains(shell.getParent()))
.toList();
assertTrue(topLevelNewShells.size() <= 1, "More than one new top-level shell was found");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add the shell titles to the fail message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done in a separate commit, so the change is easy to review; I'll squash it once you're happy with it. Since content assist popups have an empty title, I also added the type of each shell's child controls. Checked by temporarily disabling the child-popup filter, a failure now looks like:

More than one new top-level shell was found: ['' [Table], '' [Composite]]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@trancexpress are you ok with the changes, can I resolve the comment?

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   45m 25s ⏱️ - 3m 9s
 8 461 tests ±0   8 219 ✅ ±0  242 💤 ±0  0 ❌ ±0 
21 261 runs  ±0  20 579 ✅ +1  682 💤  - 1  0 ❌ ±0 

Results for commit 9f3252d. ± Comparison against base commit 3d25b65.

♻️ This comment has been updated with latest results.

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