Skip to content

Fix flaky config env-var test race#675

Merged
yoshuawuyts merged 1 commit into
mainfrom
yoshuawuyts/fix-config-env-test-race
Jun 2, 2026
Merged

Fix flaky config env-var test race#675
yoshuawuyts merged 1 commit into
mainfrom
yoshuawuyts/fix-config-env-test-race

Conversation

@yoshuawuyts
Copy link
Copy Markdown
Member

The config tests test_config_file_path_override_with_env_var and test_new_method_without_wassette_config_file_env both mutated the shared WASSETTE_CONFIG_FILE environment variable directly, so running in parallel they raced and intermittently failed CI (Config::new fell back to the default component directory). This switches them to the temp_env crate already used by the other env-dependent tests, which serializes env access, and removes the now-unused SetEnv helper.

The config tests test_config_file_path_override_with_env_var and
test_new_method_without_wassette_config_file_env both mutated the shared
WASSETTE_CONFIG_FILE environment variable using a manual SetEnv helper and
std::env::remove_var. When run in parallel they raced, intermittently
clearing the var set by one test and causing Config::new to fall back to the
default component directory.

Use the temp_env crate (already used by the other env-dependent tests in
this module) to serialize access to the environment variable, and remove the
now-unused SetEnv helper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yoshuawuyts yoshuawuyts merged commit b985416 into main Jun 2, 2026
34 of 35 checks passed
@yoshuawuyts yoshuawuyts deleted the yoshuawuyts/fix-config-env-test-race branch June 2, 2026 13:25
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