From e6ce574ff4734f94230afbbca6526606ff7a05c5 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:08:35 +0400 Subject: [PATCH] test: linux sandbox flags --- src-tauri/src/profile/password_browser_tests.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/profile/password_browser_tests.rs b/src-tauri/src/profile/password_browser_tests.rs index 581e6d2b..d9113bcf 100644 --- a/src-tauri/src/profile/password_browser_tests.rs +++ b/src-tauri/src/profile/password_browser_tests.rs @@ -76,7 +76,8 @@ async fn cdp(ws_url: &str, method: &str, params: Value) -> Value { /// button does. Returns the names of the cookies the browser had on start. async fn browser_session(user_data_dir: &Path, new_cookie: &str) -> Vec { let port = WayfernManager::find_free_port().await.unwrap(); - let mut child = tokio::process::Command::new(wayfern_executable()) + let mut command = tokio::process::Command::new(wayfern_executable()); + command .arg(format!("--remote-debugging-port={port}")) .arg("--remote-debugging-address=127.0.0.1") .arg(format!("--user-data-dir={}", user_data_dir.display())) @@ -89,9 +90,15 @@ async fn browser_session(user_data_dir: &Path, new_cookie: &str) -> Vec .arg("--headless=new") .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) - .spawn() - .expect("the browser starts"); + .stderr(std::process::Stdio::null()); + // As a launch does on Linux, where the browser aborts without them. + #[cfg(target_os = "linux")] + command.args([ + "--no-sandbox", + "--disable-setuid-sandbox", + "--disable-dev-shm-usage", + ]); + let mut child = command.spawn().expect("the browser starts"); let pid = child.id().unwrap(); // Reaped as soon as it exits, or the stop below sees a zombie as running. let reaper = tokio::spawn(async move { child.wait().await });