mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-07 03:00:29 +00:00
Fix release CI test failures caused by telemetry fork flushing stdout
The double-fork in spawn_detached_unix inherited unflushed stdout/stderr buffers from the parent process. When the intermediate child called std::process::exit(0), libc cleanup flushed these buffers again, causing duplicate output that broke trycmd snapshot comparisons in release builds (where telemetry defaults to enabled). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0fdf355d39
commit
0937d5ce48
1 changed files with 7 additions and 0 deletions
|
|
@ -25,6 +25,13 @@ pub fn spawn_detached(args: &[&str], env: &[(&str, &str)]) {
|
|||
fn spawn_detached_unix(args: &[&str], env: &[(&str, &str)]) {
|
||||
use fork::{fork, setsid, Fork};
|
||||
|
||||
// Flush stdout/stderr before forking so the child process doesn't inherit
|
||||
// buffered data that would be flushed again on child exit, causing
|
||||
// duplicate or corrupted output.
|
||||
use std::io::Write;
|
||||
let _ = std::io::stdout().flush();
|
||||
let _ = std::io::stderr().flush();
|
||||
|
||||
// First fork — parent returns immediately.
|
||||
match fork() {
|
||||
Ok(Fork::Parent(_)) => {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue