fix: don't inherit stdout from parent (#14871)

This commit is contained in:
goosewobbler
2026-02-03 14:20:42 +00:00
committed by GitHub
parent eb5d88427a
commit 06f911aaff
2 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'tauri-driver': 'patch:bug'
---
Prevent native WebDriver stdout from polluting tauri-driver's stdout used by test frameworks.

View File

@@ -1,9 +1,12 @@
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// Copyright 2019-2026 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use crate::cli::Args;
use std::{env::current_dir, process::Command};
use std::{
env::current_dir,
process::{Command, Stdio},
};
// the name of the binary to find in $PATH
#[cfg(target_os = "linux")]
@@ -48,5 +51,11 @@ pub fn native(args: &Args) -> Command {
cmd.env("TAURI_WEBVIEW_AUTOMATION", "true"); // 2.x
cmd.arg(format!("--port={}", args.native_port));
cmd.arg(format!("--host={}", args.native_host));
// Don't inherit stdout from parent to prevent native WebDriver binary/HTTP protocol data
// from corrupting tauri-driver's stdout (which gets captured by the test framework).
// Keep stderr inherited so WebDriver logs/errors are still visible.
cmd.stdout(Stdio::null());
cmd
}