Fix race condition in ProgressContantsTest.testKeepOneProperty #3532
+4
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the flaky
testKeepOnePropertytest that intermittently failed withexpected:<1> but was:<0>due to a race condition.Problem
The test was asserting the KEEPONE property result before the async cleanup logic had completed. The previous fix (commit 39d028e) added an error job as a synchronization marker, but this wasn't sufficient as the cleanup can still be pending after the error job appears in the progress view.
Solution
This fix adds explicit waits for the actual condition being tested: that exactly 1 item from the DummyFamilyJob family remains in the progress view. By using
processEventsUntil(() -> countBelongingProgressItems(DummyFamilyJob.class) == 1, timeout), we ensure the KEEPONE cleanup has fully stabilized before asserting.Changes
Testing
Verified the fix by running the test 5 times consecutively - all passed successfully.
Related
Fixes: https://github.com/eclipse-platform/eclipse.platform.ui/runs/55056915330
🤖 Generated with Claude Code