fix: Resolve flaky CI tests with process synchronization #6
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 intermittent test failures on GitHub Actions where 16-25 tests were failing non-deterministically due to process-spawning race conditions.
Problem
Root Cause Analysis
Identified 7 critical race conditions:
Solution
Applied systematic fixes across 4 test files:
1. Process Synchronization (Primary Fix)
2. File System Flush Delays
3. Improved Cleanup with Retry Logic
Changes
Files Modified: 5
Impact: +150 lines, -34 lines
Test Results
Local Testing (macOS)
```
✅ Run 1: 414/414 passed (14.2s)
✅ Run 2: 414/414 passed (14.0s)
✅ Run 3: 414/414 passed (14.0s)
✅ Run 4: 414/414 passed (14.0s)
Pass Rate: 100% (4/4 runs)
```
Expected CI Results
Why This Works
Verification Plan
Related Issues
Checklist
Note: This PR focuses exclusively on test infrastructure improvements. Zero changes were made to application code in `src/MDTool/*`.