test: fix flaky test_launch_options_from_env_defaults due to missing EnvGuard (#763)

The test was reading AGENT_BROWSER_HEADED without holding ENV_MUTEX,
causing a race with test_launch_options_from_env_headed_flag when
tests run in parallel.
This commit is contained in:
mikewong23571
2026-03-13 12:18:40 -05:00
committed by GitHub
parent d40fd4009d
commit d4b948c1d4
+1
View File
@@ -5267,6 +5267,7 @@ mod tests {
#[test]
fn test_launch_options_from_env_defaults() {
let _guard = EnvGuard::new(&["AGENT_BROWSER_HEADED"]);
let opts = launch_options_from_env();
assert!(opts.headless);
assert!(opts.args.is_empty());