Commit 39cf286
committed
Fix flaky ResourceInitialSelectionTest via pipeline scheduling rule
FilteredItemsSelectionDialog's background pipeline has three jobs that
read and write the same ContentProvider state: FilterHistoryJob mutates
it via contentProvider.reset() and contentProvider.addHistoryItems(),
FilterJob populates it via contentProvider.add() (inside
fillContentProvider), and RefreshCacheJob reads it in
contentProvider.reloadCache(). Without a shared scheduling rule they can
run concurrently on different worker threads.
Under the right timing, FilterHistoryJob.contentProvider.reset() clears
the items set on one worker while FilterJob is iterating members() and
adding items on another - wiping some or all of the populated items
before the table is rendered. This manifested as the long-standing
ResourceInitialSelectionTest flake (issue #294): sometimes the table was
empty, sometimes a random subset of items survived in the wrong order.
The race is reliably triggered by the ModifyListener on the pattern Text
firing applyFilter() twice in quick succession during createDialogArea
on slow runners, which schedules two FilterHistoryJobs that overlap with
the FilterJob.
Fix: share a per-dialog ISchedulingRule across filterHistoryJob,
filterJob and refreshCacheJob. They now serialize; the race cannot
occur. Separate dialogs still run in parallel.
Also expose JOB_FAMILY (@noreference) and tag all four pipeline jobs
with it, so tests can deterministically wait for the pipeline via
Job.getJobManager().find(JOB_FAMILY). The item-count stability probe in
ResourceInitialSelectionTest.waitForDialogRefresh() is replaced with
that family-based wait - this also gets rid of the unreliable 5 s
timeout that was the visible symptom.
Fixes #2941 parent 7f7e4b6 commit 39cf286
3 files changed
Lines changed: 91 additions & 32 deletions
File tree
- bundles/org.eclipse.ui.workbench
- .settings
- eclipseui/org/eclipse/ui/dialogs
- tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
5 | 13 | | |
| |||
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
239 | 251 | | |
240 | 252 | | |
241 | 253 | | |
| |||
250 | 262 | | |
251 | 263 | | |
252 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
253 | 276 | | |
254 | 277 | | |
255 | 278 | | |
256 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
257 | 295 | | |
258 | 296 | | |
259 | 297 | | |
| |||
1315 | 1353 | | |
1316 | 1354 | | |
1317 | 1355 | | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1318 | 1361 | | |
1319 | 1362 | | |
1320 | 1363 | | |
| |||
1420 | 1463 | | |
1421 | 1464 | | |
1422 | 1465 | | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
1423 | 1471 | | |
1424 | 1472 | | |
1425 | 1473 | | |
| |||
1854 | 1902 | | |
1855 | 1903 | | |
1856 | 1904 | | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
1857 | 1910 | | |
1858 | 1911 | | |
1859 | 1912 | | |
| |||
1977 | 2030 | | |
1978 | 2031 | | |
1979 | 2032 | | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
1980 | 2038 | | |
1981 | 2039 | | |
1982 | 2040 | | |
| |||
Lines changed: 25 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
170 | | - | |
171 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
277 | | - | |
278 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
279 | 288 | | |
280 | 289 | | |
281 | 290 | | |
| |||
448 | 457 | | |
449 | 458 | | |
450 | 459 | | |
451 | | - | |
452 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
453 | 467 | | |
454 | 468 | | |
455 | 469 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
| 470 | + | |
466 | 471 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 472 | + | |
479 | 473 | | |
480 | | - | |
481 | | - | |
| 474 | + | |
482 | 475 | | |
483 | 476 | | |
484 | 477 | | |
| |||
0 commit comments