From d4b948c1d4faa425c35491f0b04a2e21a4171e9f Mon Sep 17 00:00:00 2001 From: mikewong23571 Date: Sat, 14 Mar 2026 01:18:40 +0800 Subject: [PATCH] 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. --- cli/src/native/actions.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/src/native/actions.rs b/cli/src/native/actions.rs index 8f04acc..4d6d13b 100644 --- a/cli/src/native/actions.rs +++ b/cli/src/native/actions.rs @@ -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());