test(explain): merge racing CSHIP_ACCOUNT tests into one - #206
Merged
Merged
Conversation
`std::env::set_var` is process-global, so the malformed-env and empty-env tests clobbered each other when cargo scheduled them concurrently — the empty test's " " (or its remove_var) could land between the malformed test's set_var and its assertion, dropping CSHIP_ACCOUNT from the hint. Failed on Windows CI for main (run 34024827695); passes on reruns. Merging both cases into one test makes them sequential by construction, no mutex or serial-test dependency needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
test_render_passthrough_returns_none_for_nonexistent_module resolves `starship` from PATH but did not hold PATH_MUTEX. Sibling tests point PATH at mock starship scripts that print output, so an overlap made render_passthrough return Some(...) and the assert fail (ubuntu CI). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
stephenleo
force-pushed
the
fix/explain-account-env-test-race
branch
from
September 6, 2026 10:14
a482c73 to
43c804c
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.
Fixes the flaky
Test (windows-latest)failure on main (run 34024827695).test_error_hint_account_malformed_env_names_env_as_causeandtest_error_hint_account_empty_env_falls_back_to_credential_probeboth mutate the process-globalCSHIP_ACCOUNT. Cargo runs them on separate worker threads, so the empty-env test'sset_var(" ")/remove_varcan land between the malformed test'sset_var("{not json")and its assertion — the hint then omitsCSHIP_ACCOUNTand the assert fails. The stale comment claiming "no other test in this file touches CSHIP_ACCOUNT" was the tell.Merged both cases into a single test, which makes them sequential by construction — no mutex or
serial_testdependency.fmt / clippy / 605 tests green locally.
🤖 Generated with Claude Code