fix(test): serialize env-mutating tests to prevent flaky failures#718
Merged
fix(test): serialize env-mutating tests to prevent flaky failures#718
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #718 +/- ##
==========================================
+ Coverage 68.79% 68.79% +0.01%
==========================================
Files 46 46
Lines 30992 30998 +6
==========================================
+ Hits 21318 21324 +6
Misses 9674 9674 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tests that call std::env::set_var/remove_var race when run in parallel, causing intermittent failures. Add a static LazyLock<Mutex<()>> and acquire it in every env-mutating test so they execute serially. Affected tests: - startup_file_returns_psqlrc_env_when_set - startup_file_returns_none_when_no_rc_exists_and_no_env - resolve_api_key_env_var - resolve_api_key_missing_env_var - resolve_api_key_empty_env_var Closes #717
de8fe0d to
97c9400
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.
Closes #717
Adds ENV_MUTEX static to serialize all tests that call set_var/remove_var.