From fd5e261ff2eef7abcd3ebcf604d5f9dfad1dd9de Mon Sep 17 00:00:00 2001 From: Eli Nimad Date: Thu, 6 Aug 2026 16:58:38 -0700 Subject: [PATCH] fix(tests): give the secondmate-harness crew spawn the lease-capable fake treehouse The crew-unaffected block spawns an ordinary ship task through fm-spawn.sh, which since the allocator-lease change (#5) takes the task worktree from 'treehouse get --lease' before confirming it against the pane probe. That block's fakebin carried no treehouse at all and the test's BASE_PATH is the bare system directories, so the spawn died on a missing allocator before writing its meta record and the crew-unaffected assertion failed deterministically, in CI and locally. The lease change migrated every other spawn-driving test to tests/lib.sh's shared fake treehouse but missed this file. Install the shared fake in make_launch_capturing_tmux, whose stub set exists exactly to serve the crew/scout spawn path. The fake leases FM_FAKE_PANE_PATH, so the recorded worktree and the pane witness agree and the confirmation step is exercised rather than bypassed. Secondmate spawns never consult the allocator and are unaffected. --- tests/fm-secondmate-harness.test.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fm-secondmate-harness.test.sh b/tests/fm-secondmate-harness.test.sh index e2c18a1b411..b4d76ebc722 100755 --- a/tests/fm-secondmate-harness.test.sh +++ b/tests/fm-secondmate-harness.test.sh @@ -572,11 +572,13 @@ meta_field() { grep "^$2=" "$1" 2>/dev/null | tail -1 | cut -d= -f2-; } # `send-keys -l ` launch command into FM_FAKE_LAUNCH_LOG, mirroring the # capture technique in fm-spawn-dispatch-profile.test.sh so the constructed # launch command (not just meta) can be asserted on. Also answers the -# `#{pane_current_path}` probe from FM_FAKE_PANE_PATH so this same stub works -# for a crew/scout (non-secondmate) spawn's treehouse-worktree wait loop. +# `#{pane_current_path}` probe from FM_FAKE_PANE_PATH, and carries the shared +# lease-capable fake treehouse, so this same stub set works for a crew/scout +# (non-secondmate) spawn's leased-worktree acquisition and confirmation. make_launch_capturing_tmux() { local dir=$1 fakebin="$1/fakebin" mkdir -p "$fakebin" + fm_fake_treehouse "$fakebin" cat > "$fakebin/tmux" <<'SH' #!/usr/bin/env bash set -u