Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

test(remote): der echte cloudflared-Stand-in wartet ETXTBSY auf Linux ab

David4dccafa4e4bd
diff --git a/src-tauri/src/commands/remote.rs b/src-tauri/src/commands/remote.rs
index 4faa9676..46a069fe 100644
--- a/src-tauri/src/commands/remote.rs
+++ b/src-tauri/src/commands/remote.rs
@@ -4133,14 +4133,32 @@ mod remote_hardening_tests {
let bin = dir.path().join("cloudflared");
std::fs::copy(&park, &bin).expect("copy the stand-in");
- let child = Command::new(&bin)
- .args(["tunnel", "--url", &format!("http://127.0.0.1:{port}")])
- .stdin(Stdio::piped())
- .stdout(Stdio::null())
- .stderr(Stdio::null())
- .spawn()
- .expect("spawn the stand-in");
- (dir, child)
+ // ETXTBSY on Linux, two runs out of seven on a fresh Ubuntu 22.04
+ // (2026-09-05): while `copy` held the write end of `bin`, another test
+ // thread forked its own stand-in; that child inherits every fd and
+ // only drops the CLOEXEC ones at ITS exec, and the busy check for OUR
+ // exec runs before that. The copy is long closed here, the stale copy
+ // of its fd is not ours to close, so the spawn waits it out.
+ let mut child = None;
+ for _ in 0..200 {
+ match Command::new(&bin)
+ .args(["tunnel", "--url", &format!("http://127.0.0.1:{port}")])
+ .stdin(Stdio::piped())
+ .stdout(Stdio::null())
+ .stderr(Stdio::null())
+ .spawn()
+ {
+ Ok(c) => {
+ child = Some(c);
+ break;
+ }
+ Err(e) if e.kind() == std::io::ErrorKind::ExecutableFileBusy => {
+ std::thread::sleep(std::time::Duration::from_millis(10));
+ }
+ Err(e) => panic!("spawn the stand-in: {e}"),
+ }
+ }
+ (dir, child.expect("spawn the stand-in: still text-file-busy after two seconds"))
}
/// The positive end-to-end direction, and the one T-39 depends on: a real,