Repository navigation
fix: Serialize HOME-sensitive unit tests - #344
Merged
Merged
Conversation
Hold the shared HOME guard across direct readers and SSH configuration, path expansion, authentication, and session policy tests. Keep HOME-mutating tests on their existing guard to avoid reentrant locking. Add a bounded parallel reproduction tool that preserves every run's output, and include command diagnostics in the plain-key fallback assertion. The 1,000-run baseline failed 36 times; the same 14-test selection passed all 1,000 runs after locking.
inureyes
force-pushed
the
fix/issue-335-home-test-locking
branch
from
October 22, 2026 14:18
7228731 to
836bde4
Compare
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.
HOME-sensitive unit tests now share the writer's lock, including indirect reads through SSH configuration resolution, authentication defaults, session policies, and KnownHostsCommand contexts. Existing HOME writers keep their single guard; the helper documents the non-reentrant locking rule.
The plain-key fallback test constructs a KnownHostsCommand context that reads HOME; its script, output, and log use a unique temporary directory. Its original failure did not reproduce (0/1,000 before and after), so this does not claim to establish that flake's cause. Assertion diagnostics now include invocation logs and command output, and
tools/test-home-races.pypreserves stdout, stderr, backtraces, timeout failures, and a summary for every run.Validation:
/home/user/.ssh/otherversus/home/inureyes/.ssh/other.Audit exclusions: app tests run in a separate binary without HOME mutations; keygen tests never call the HOME-reading entrypoint; config-cache tests load explicit paths; the historical
interactive_unit_test.rsis not compiled, while its current replacement already locks HOME. Production behavior is unchanged.Closes #335