Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Nov 4, 2025

Summary

  • Fixes the race condition causing ProgressViewTests.testItemOrder to fail randomly
  • Addresses the timing issues with ProgressViewerComparator's stable sorting mechanism

Root Cause

The test was failing due to a race condition with the ProgressViewerComparator's lastIndexes HashMap:

  • The comparator maintains previous positions to provide visual stability (preventing jobs from jumping in the UI)
  • Throttled updates during job scheduling caused jobs to be added to lastIndexes in schedule order
  • This created an inconsistent baseline where stable sorting preserved schedule order instead of priority order

Solution

  • Reopen the progress view after all jobs are scheduled and running to reset the comparator's state
  • This ensures all jobs are sorted by priority from a clean lastIndexes state
  • Removed the unreliable timing-based approach that tried to manipulate throttled updates with a dummy job

Testing

  • Test now passes reliably (verified with 3 consecutive runs)
  • Works with the stable sorting behavior rather than against it

Test Plan

  • Run ProgressViewTests.testItemOrder multiple times - all pass
  • Verified fix addresses the race condition described in issue

Fixes #195

🤖 Generated with Claude Code

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Test Results

 3 018 files  +1 006   3 018 suites  +1 006   2h 5m 5s ⏱️ + 49m 46s
 8 234 tests ±    0   7 985 ✅ ±    0  249 💤 ±  0  0 ❌ ±0 
23 622 runs  +7 874  22 828 ✅ +7 579  794 💤 +295  0 ❌ ±0 

Results for commit 4da373c. ± Comparison against base commit 6f2025c.

♻️ This comment has been updated with latest results.

@vogella
Copy link
Contributor Author

vogella commented Nov 4, 2025

@HeikoKlare any concern? I think this makes sense

@vogella vogella force-pushed the fix-flaky-progress-view-test branch 3 times, most recently from 39af270 to c668b83 Compare November 7, 2025 17:59
The test was failing randomly due to a race condition with the
ProgressViewerComparator's stable sorting mechanism (lastIndexes).

Root cause:
- The comparator maintains a HashMap of previous positions to provide
  visual stability (preventing jobs from jumping around in the UI)
- During test execution, throttled updates would occur while jobs were
  being scheduled, causing some jobs to be added to lastIndexes before
  others
- This resulted in an inconsistent baseline where jobs were sorted by
  schedule order rather than priority order

Fix:
- Reopen the progress view after all jobs are scheduled and running to
  reset the comparator's lastIndexes state
- This ensures all jobs are sorted by priority from a clean state,
  eliminating the race condition
- Removed the unreliable timing-based approach that tried to manipulate
  throttled updates

The test now passes reliably by working with the stable sorting
behavior rather than against it.

Fixes eclipse-platform#195

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vogella vogella force-pushed the fix-flaky-progress-view-test branch from c668b83 to 4da373c Compare November 8, 2025 13:32
@vogella vogella merged commit f655706 into eclipse-platform:master Nov 9, 2025
18 checks passed
@vogella vogella deleted the fix-flaky-progress-view-test branch November 9, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] ProgressViewTests.testItemOrder is flaky

1 participant