Commit 535b055
Fix sporadic MarkerTest.testMarkerDeltasMoveFile failure
The test performed two separate IFile.move() calls, creating a window
where background jobs (e.g. charset/encoding validation) could acquire
the workspace lock between the two moves and fire resource change events
that added unexpected marker deltas for subFile. This caused the
listener to record 2 changes for /MyProject/folder/subFile.txt while
the test expected exactly 1.
Fix: wrap both moves in a single IWorkspaceRunnable so the workspace
lock is held throughout both operations, preventing background jobs
from interleaving and ensuring a single coalesced event with exactly
the 4 expected changes.
To reproduce the race before the fix, run the test ~200 times in a loop:
mvn -pl resources/tests/org.eclipse.core.tests.resources \
-Pbuild-individual-bundles \
-Dtest=MarkerTest#testMarkerDeltasMoveFile \
-Dsurefire.rerunFailingTestsCount=0 \
verify
and repeat the invocation 200 times; the failure should appear within
that many iterations. With the fix, 200 runs should all succeed.
Co-authored-by: fedejeanne <2205684+fedejeanne@users.noreply.github.com>1 parent 519a3b0 commit 535b055
File tree
1 file changed
+7
-3
lines changed- resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources
1 file changed
+7
-3
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
973 | | - | |
974 | | - | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
975 | 979 | | |
976 | 980 | | |
977 | 981 | | |
| |||
0 commit comments