Skip to content

test(tui): isolate WHYCODES_HOME in the decision-model catalog test - #474

Merged
mrnasil merged 3 commits into
mainfrom
test/tui-catalog-env-lock
Nov 25, 2026
Merged

mrnasil merged 3 commits into
mainfrom
test/tui-catalog-env-lock

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

Flaky test seen on the Coverage job of #472:

app::state_tests::catalog_models_lists_decision_models_like_a_provider ... FAILED
panicked at crates/tui/src/app_state_tests.rs:1644:5: empty catalog keeps its hint

catalog_models also lists OAuth providers that have a stored token, read from WHYCODES_HOME. catalog_models_merges_oauth_token_store_suggestions holds ENV_LOCK while it points WHYCODES_HOME at a home with a token. The decision-model test (#458) read the token store without the lock, so when the two overlapped, its "empty catalog" assertion saw that token.

The test now holds ENV_LOCK and uses an empty home of its own, restoring the previous value before it asserts. Test-only change.

cargo test -p whycodes-tui --lib catalog_models (3 pass), clippy, ratchets.

🤖 Generated with Claude Code

mrnasil and others added 3 commits November 25, 2026 06:27
catalog_models also lists OAuth providers that have a stored token,
read from WHYCODES_HOME. catalog_models_merges_oauth_token_store_suggestions
points that at a home holding a token under ENV_LOCK; the decision-model
test read it without the lock, so when the two overlapped its "empty
catalog" saw the token and failed (Coverage on #472). It now holds
ENV_LOCK and uses an empty home of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil merged commit b70a0e0 into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the test/tui-catalog-env-lock branch November 25, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant