fix(parser): merge gemini env-var tests to avoid cargo-parallel race#148
Merged
Conversation
The two `GEMINI_CLI_HOME` tests ran in parallel under cargo test and clobbered each other's env state — case 2's `remove_var` ran while case 1 was mid-assertion, producing intermittent failures on main CI. Combine both scenarios into a single `#[test]` so they execute serially within one thread.
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
Main CI broke immediately after #145 merged.
test_gemini_cli_home_env_var_overrides_homegot\"/home/runner/.gemini/tmp\"instead of the expected/tmp/toktrack-gemini-env-test/...— the sibling testtest_gemini_cli_home_empty_string_falls_through(running in parallel) had already restoredGEMINI_CLI_HOMEviaremove_varbefore case 1 finished asserting.The reviewer flagged this as P1#1 during /review; I dismissed it because the repo already follows the same pattern in
src/services/pricing.rs. The pricing tests have apparently been lucky so far; the gemini pair surfaced the race because both tests touch the same env var with different expected values.Fix
Combine both scenarios into a single
#[test]so they run serially in one thread. No mutex, no extra crate — minimal diff.Test plan
cargo test --lib parsers::gemini— 19 passed (was 20 before, one less because merged)