Skip to content

Serialize environment variable modifications in Rust tests via global mutex. - #2185

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/964734117
Open

Serialize environment variable modifications in Rust tests via global mutex.#2185
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/964734117

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Serialize environment variable modifications in Rust tests via global mutex.

In Google FuzzTest Rust tests, tests modifying environment variables previously required running in single-threaded mode via --test-threads=1 to avoid data races across threads.

Introduce an EnvVars builder utility that acquires a global mutex lock, applies key-value environment modifications, tracks pre-existing values, and restores original environment states when dropped. Remove --test-threads=1 from Bazel test configurations, enabling full parallel test execution.

… mutex.

In Google FuzzTest Rust tests, tests modifying environment variables previously required running in single-threaded mode via `--test-threads=1` to avoid data races across threads.

Introduce an `EnvVars` builder utility that acquires a global mutex lock, applies key-value environment modifications, tracks pre-existing values, and restores original environment states when dropped. Remove `--test-threads=1` from Bazel test configurations, enabling full parallel test execution.

PiperOrigin-RevId: 964734117
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