Retry busy app-server test executable spawns (#37354)

## Why

App-server integration tests can encounter a transient `ExecutableFileBusy`
error while starting their server process.

## What changed

Retry that specific spawn failure up to twice with a 10 ms delay, while
returning all other spawn errors immediately.

GitOrigin-RevId: 0982a9fe66bae4c41f556c845d12fb515dbf752c
This commit is contained in:
jif
2026-08-07 02:00:46 +00:00
committed by copyberry
parent d0c8f422ea
commit 9afb96faff

View File

@@ -257,10 +257,20 @@ impl TestAppServer {
}
}
let mut process = cmd
.kill_on_drop(true)
.spawn()
.context("codex-mcp-server proc should start")?;
cmd.kill_on_drop(true);
let mut retries = 0;
let mut process = loop {
let process = cmd.spawn();
if !process
.as_ref()
.is_err_and(|error| error.kind() == std::io::ErrorKind::ExecutableFileBusy)
|| retries == 2
{
break process.context("codex-mcp-server proc should start")?;
}
retries += 1;
tokio::time::sleep(Duration::from_millis(10)).await;
};
let stdin = process
.stdin
.take()