diff --git a/codex-rs/rmcp-client/tests/process_group_cleanup.rs b/codex-rs/rmcp-client/tests/process_group_cleanup.rs index 8ed9ba305..bb033af87 100644 --- a/codex-rs/rmcp-client/tests/process_group_cleanup.rs +++ b/codex-rs/rmcp-client/tests/process_group_cleanup.rs @@ -24,8 +24,13 @@ async fn wait_for_pid_file(path: &Path) -> Result { for _ in 0..50 { match fs::read_to_string(path) { Ok(content) => { - let pid = content - .trim() + let trimmed = content.trim(); + if trimmed.is_empty() { + tokio::time::sleep(Duration::from_millis(100)).await; + continue; + } + + let pid = trimmed .parse::() .with_context(|| format!("failed to parse pid from {}", path.display()))?; return Ok(pid);