Problem
bundle_resolve_source_returns_none_when_nothing_resolves mutates the process-wide WTA_HOOKS_BUNDLE_DIR environment variable without acquiring crate::test_support::lock_env().
The test comment says CI uses --test-threads=1, but the WTA pipeline runs plain cargo test, whose unit tests are parallel by default. This can race with other environment-mutating tests; lock_env() is already the crate convention for guarding these mutations.
Expected behavior
Acquire the shared environment lock before reading, changing, and restoring WTA_HOOKS_BUNDLE_DIR, and update the safety comment accordingly.
Context
Found during review of #491: #491 (comment)
The test existed in the original agent_hooks_installer.rs before #491 and was moved unchanged into agent_hooks_installer_tests.rs; track the test-safety fix separately so #491 remains a file-splitting-only PR.
Problem
bundle_resolve_source_returns_none_when_nothing_resolvesmutates the process-wideWTA_HOOKS_BUNDLE_DIRenvironment variable without acquiringcrate::test_support::lock_env().The test comment says CI uses
--test-threads=1, but the WTA pipeline runs plaincargo test, whose unit tests are parallel by default. This can race with other environment-mutating tests;lock_env()is already the crate convention for guarding these mutations.Expected behavior
Acquire the shared environment lock before reading, changing, and restoring
WTA_HOOKS_BUNDLE_DIR, and update the safety comment accordingly.Context
Found during review of #491: #491 (comment)
The test existed in the original
agent_hooks_installer.rsbefore #491 and was moved unchanged intoagent_hooks_installer_tests.rs; track the test-safety fix separately so #491 remains a file-splitting-only PR.