From fe13561ca524cdbfc6e585acf9dff9d0d9b7e783 Mon Sep 17 00:00:00 2001 From: Scott Werner Date: Mon, 2 Nov 2026 13:28:54 -0500 Subject: [PATCH] Fix PID readiness race in remote workflow tests --- lib/apps/fabro-cli/src/commands/run/remote_workflow.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/apps/fabro-cli/src/commands/run/remote_workflow.rs b/lib/apps/fabro-cli/src/commands/run/remote_workflow.rs index 8bec413d7..a1742ce55 100644 --- a/lib/apps/fabro-cli/src/commands/run/remote_workflow.rs +++ b/lib/apps/fabro-cli/src/commands/run/remote_workflow.rs @@ -752,7 +752,10 @@ mod tests { #[tokio::test] async fn remote_workflow_dropped_waiter_cancels_child_before_checkout_cleanup() { - let (fake, git) = fake_git("printf '%s' $$ > pid; exec /bin/sleep 60"); + // Publish the PID only after writing it: file existence is the readiness + // signal. + let (fake, git) = + fake_git("printf '%s' $$ > pid.tmp; /bin/mv pid.tmp pid; exec /bin/sleep 60"); let checkout = tempfile::tempdir().unwrap(); let path = checkout.path().to_path_buf(); let worker = tokio::spawn(async move { @@ -1154,7 +1157,8 @@ mod tests { #[tokio::test] async fn remote_workflow_timeout_and_cancel_reap_owned_children() { for timeout in [true, false] { - let (root, mut git) = fake_git("printf '%s' $$ > pid; exec /bin/sleep 60"); + let (root, mut git) = + fake_git("printf '%s' $$ > pid.tmp; /bin/mv pid.tmp pid; exec /bin/sleep 60"); git.timeout = Duration::from_secs(2); let cancel = CancellationToken::new(); let trigger = async {