Skip to content

Commit dae6afd

Browse files
committed
no-mistakes(lint): Captain: Fix secondmate liveness lint conditional
1 parent ee3963c commit dae6afd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/fm-secondmate-liveness.test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,9 @@ SH
522522
lock="$w/home/state/.account-lifecycle-sm1.lock"
523523
assert_contains "$out" "SECONDMATE_LIVENESS: secondmate sm1: respawned" \
524524
"parent treated a successfully handed-off lock as its own release failure"
525-
[ -n "$sleeper_pid" ] && kill -0 "$sleeper_pid" 2>/dev/null \
526-
|| fail "handoff simulation did not leave its child owner alive"
525+
if [ -z "$sleeper_pid" ] || ! kill -0 "$sleeper_pid" 2>/dev/null; then
526+
fail "handoff simulation did not leave its child owner alive"
527+
fi
527528
[ "$(sed -n '1p' "$lock" 2>/dev/null)" = "$sleeper_pid" ] \
528529
|| fail "parent released or replaced the child-owned lifecycle lock"
529530
kill "$sleeper_pid" 2>/dev/null || true

0 commit comments

Comments
 (0)