From 9b3a031d5877defe8e03f1dae44ada3b3d95c420 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Thu, 24 Sep 2026 16:22:39 +0800 Subject: [PATCH] test(oak-render): probe true in /usr/bin for the dispatcher tests macOS ships true in /usr/bin (there is no /bin/true), so the immediate exit worker spawn failed with ENOENT and start_failure_restart_budget_and_accessors never reached a restart. Resolve the binary from the usual locations, falling back to PATH. --- crates/oak-render/src/procpool.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/oak-render/src/procpool.rs b/crates/oak-render/src/procpool.rs index 86cf932af..9332c797d 100644 --- a/crates/oak-render/src/procpool.rs +++ b/crates/oak-render/src/procpool.rs @@ -2647,7 +2647,7 @@ mod tests { // reserve keeps interactive/audio tickets dispatchable (the // playback-freeze regression guard). let config = DispatcherConfig { - worker_bin: Some(std::path::PathBuf::from("/bin/true")), + worker_bin: Some(true_bin()), workers: 3, slots_per_worker: 4, width: 64, @@ -2740,7 +2740,7 @@ mod tests { fn plugin_progress_line_forwards_to_callback() { let _lock = pool_test_lock(); let config = DispatcherConfig { - worker_bin: Some(std::path::PathBuf::from("/bin/true")), + worker_bin: Some(true_bin()), workers: 1, slots_per_worker: 2, width: 16, @@ -2801,9 +2801,20 @@ mod tests { format!("oak-procpool-ut-{}-{name}", std::process::id()) } + /// The immediate-exit worker binary used by the dispatcher tests: + /// macOS ships `true` in `/usr/bin` (there is no `/bin/true`), so + /// probe the usual locations before falling back to `PATH`. + fn true_bin() -> std::path::PathBuf { + ["/usr/bin/true", "/bin/true"] + .into_iter() + .map(std::path::PathBuf::from) + .find(|p| p.exists()) + .unwrap_or_else(|| std::path::PathBuf::from("true")) + } + fn test_config(workers: usize, slots: u32) -> DispatcherConfig { DispatcherConfig { - worker_bin: Some(std::path::PathBuf::from("/bin/true")), + worker_bin: Some(true_bin()), workers, slots_per_worker: slots, width: 16,