Commit 2403be7
committed
Fix flaky LinkHelperTest.testLinkHelperEditorActivation
When link-with-editor is enabled, the IPartListener in LinkEditorAction
scheduled updateSelectionJob from both partActivated and partBroughtToTop.
Both events fire for the same editor activation, so under normal timing the
second schedule() call merely resets the job timer and the job runs once.
However, on slow machines (CI on Linux/GTK) the two events can fire more
than LINK_HELPER_DELAY (120 ms) apart, causing the job to complete from the
first event and then be rescheduled and run again from the second. This
results in findSelection() being called twice, breaking the assertion
assertEquals(1, findSelectionCount) in testLinkHelperEditorActivation.
Fix: remove the job scheduling from partBroughtToTop. The partActivated
event is the correct signal for "an editor became active", which is exactly
what the link-with-editor feature needs to track.
Fixes #13381 parent 0b9521c commit 2403be7
1 file changed
Lines changed: 6 additions & 3 deletions
File tree
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
0 commit comments