fix(test): use PID-scoped script path to prevent ETXTBSY in CI
The echo_provider() test helper writes a fake_claude.sh script to a shared temp directory. When lib and bin test binaries run in parallel (separate processes, separate OnceLock statics), one process can overwrite the script while the other is executing it, causing "Text file busy" (ETXTBSY). Scope the filename with PID to isolate each test process. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b7ad393858
commit
3430f9bf1a
@ -387,7 +387,7 @@ mod tests {
|
||||
use std::io::Write;
|
||||
let dir = std::env::temp_dir().join("zeroclaw_test_claude_code");
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let path = dir.join("fake_claude.sh");
|
||||
let path = dir.join(format!("fake_claude_{}.sh", std::process::id()));
|
||||
let mut f = std::fs::File::create(&path).unwrap();
|
||||
writeln!(f, "#!/bin/sh\ncat /dev/stdin").unwrap();
|
||||
drop(f);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user