Open
Conversation
Adds poison-recovery helpers to prevent cascading test failures when a test panics while holding a mutex lock. Changes: - Add lock_test_mutex() helper functions to all modules with test mutexes - Replace all test_mutex().lock().unwrap() calls with lock_test_mutex() - Automatically recover poisoned mutexes using unwrap_or_else Impact: - Reduced parallel test failures significantly - All 207 tests pass when run sequentially (--test-threads=1) - Remaining parallel failures are due to other isolation issues (PATH, temp files) that require per-test refactoring Modules updated: - src/index/mod.rs - src/logic/mod.rs - src/state/mod.rs - src/sources/mod.rs - src/theme/mod.rs - All test files using test mutexes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 cascading test failures caused by mutex poisoning when tests panic while holding locks.
Problem
When a test panicked while holding a test mutex, the mutex became "poisoned" and all subsequent tests calling
.lock().unwrap()would fail withPoisonError, causing cascading test failures even though the test logic was correct.Solution
lock_test_mutex()helper functions to all modules with test mutexes.unwrap_or_else(|e| e.into_inner())to automatically recover poisoned mutexes.lock().unwrap()with the poison-safe helperResults
Before:
After:
Impact:
Remaining Issues
The remaining 15 parallel test failures are due to other isolation issues:
These require per-test refactoring and are tracked separately.
Files Changed
21 files updated across all modules with test mutexes:
src/index/mod.rs+ 7 test filessrc/logic/mod.rs+ 3 test filessrc/state/mod.rs+ test filesrc/sources/mod.rs+ 3 test filessrc/theme/mod.rs+ 3 test files