mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user