Commit c8e1aba
Fix flaky HoverTest.testEnabledWhenHover() race condition
The testEnabledWhenHover test was failing randomly when trying to retrieve
the hover shell for the second part of the test.
Root cause:
- The test has two parts: first with EnabledPropertyTester.setEnabled(true),
then with setEnabled(false)
- After the first hover is shown and checked, cleanFileAndEditor() is called
- However, the hover shell from the first part may not be fully disposed
when the second editor is opened and the second hover is triggered
- This causes getHoverShell() to timeout waiting for the new hover shell
Fix:
- Capture a reference to the first hover shell before calling cleanFileAndEditor()
- After cleanFileAndEditor(), explicitly wait for the first shell to be disposed
using DisplayHelper.waitForCondition() with a 3000ms timeout
- This ensures the hover state is fully reset before the second part begins
This approach follows the pattern used in other recent flaky test fixes in
this repository (e.g., ProgressContantsTest, ProgressViewTests) which use
condition-based waiting to ensure proper cleanup between test phases.
Fixes #926
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 6c82a83 commit c8e1aba
File tree
1 file changed
+7
-0
lines changed- tests/org.eclipse.ui.genericeditor.tests/src/org/eclipse/ui/genericeditor/tests
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
0 commit comments