Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/lease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1031,15 +1031,15 @@ EOF
}

run_reclaimer B "$shim:$PATH" & bpid=$!
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -e "$state/b-paused-once" ] || [ -e "$state/B-ready" ] || { sleep 0.05; continue; }
break
done
[ -e "$state/b-paused-once" ] || [ -e "$state/B-ready" ] ||
{ kill "$bpid" 2>/dev/null || :; echo "reclaimer B did not reach acquisition"; return 1; }

run_reclaimer A "$PATH" & apid=$!
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -e "$state/A-ready" ] && [ -e "$state/B-ready" ] || { sleep 0.05; continue; }
break
done
Expand Down Expand Up @@ -1255,7 +1255,7 @@ t48_prelaunch_interrupt_releases_without_poison() (
pid=$!
set +m
count=0
while [ ! -e "$marker" ] && [ "$count" -lt 100 ]; do
while [ ! -e "$marker" ] && [ "$count" -lt 600 ]; do
sleep 0.05
count=$((count + 1))
done
Expand Down
28 changes: 16 additions & 12 deletions tests/liveness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ t10_watchdog_signal_is_terminal() {
) > "$state/output" 2>&1 &
pid=$!
set +m
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -s "$state/status.pid" ] &&
grep -q '^status task-fake0000-aaaaaa --json$' "$state/calls.log" && break
sleep 0.05
Expand Down Expand Up @@ -791,7 +791,7 @@ t11_loop_signal_is_terminal() {
) > "$state/output" 2>&1 &
pid=$!
set +m
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
grep -q '^status task-fake0000-aaaaaa --json$' "$state/calls.log" && break
sleep 0.05
done
Expand Down Expand Up @@ -831,7 +831,7 @@ t12_loop_signal_reaps_verifier() {
) > "$state/output" 2>&1 &
pid=$!
set +m
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -s "$state/child.pid" ] && break
sleep 0.05
done
Expand Down Expand Up @@ -877,7 +877,7 @@ t13_prelaunch_generation_fence() {
) > "$state/output" 2>&1 &
pid=$!
set +m
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
grep -q '^--help$' "$state/calls.log" && break
sleep 0.05
done
Expand All @@ -898,31 +898,35 @@ t13_prelaunch_generation_fence() {
}

t14_midpoint_warning_continues_same_job() {
local repo state pid warnings tasks
local repo state pid warnings tasks ceiling=12 warning
repo=$(new_repo budget-midpoint-repo)
state="$TEST_ROOT/budget-midpoint-state"
warning="^MAESTRO_BUDGET: .*continuing to the ${ceiling}s hard ceiling"
mkdir -p "$state"
: > "$state/calls.log"
status_empty > "$state/status.json"
# Pin verification consumes the first phase; leave five running poll samples before completion.
printf 'running\nrunning\nrunning\nrunning\nrunning\nrunning\ncompleted\n' > "$state/phases"
set -m
(
cd "$repo" &&
exec env HOME="$TEST_HOME" PATH="$TEST_PATH" \
MAESTRO_TEST_CALL_LOG="$state/calls.log" \
MAESTRO_TEST_JOB_PHASE_FILE="$state/phases" \
MAESTRO_TEST_JOB_TERMINAL_FLAG="$state/complete" \
MAESTRO_TEST_STATUS="$state/status.json" \
MAESTRO_MAX_DISPATCH_SEC=8 \
MAESTRO_MAX_DISPATCH_SEC="$ceiling" \
bash "$LOOP" --plan "$TEST_ROOT/plan.md" --verify true \
--max-iters 1 --max-idle 30 --poll 1
) > "$state/output" 2>&1 &
pid=$!
set +m
wait_bounded "$pid" 11
for _ in $(seq 1 240); do
grep -q "$warning" "$state/output" && break
sleep 0.05
done
grep -q "$warning" "$state/output" && : > "$state/complete"
wait_bounded "$pid" 17
[ "$WAIT_TIMED_OUT" -eq 0 ] || { echo "midpoint completion exceeded bound"; return 1; }
[ "$WAIT_RC" -eq 0 ] || { echo "rc=$WAIT_RC want 0: $(tr '\n' ' ' < "$state/output")"; return 1; }
warnings=$(grep -c '^MAESTRO_BUDGET: .*continuing to the 8s hard ceiling' "$state/output" || true)
warnings=$(grep -c "$warning" "$state/output" || true)
tasks=$(grep -c '^task ' "$state/calls.log" || true)
[ "$warnings" -eq 1 ] || { echo "midpoint warnings=$warnings want 1"; return 1; }
[ "$tasks" -eq 1 ] || { echo "task starts=$tasks want 1"; return 1; }
Expand Down Expand Up @@ -1093,7 +1097,7 @@ t19_waiting_contender_signal_does_not_cancel_owner() (
) > "$state/output" 2>&1 3>&1 &
pid=$!
set +m
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
grep -q 'waiting for the write lease' "$state/output" && break
sleep 0.05
done
Expand Down
4 changes: 2 additions & 2 deletions tests/provenance-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ EOF
PATH="$shim:$PATH" write_lock_release
) > "$state/holder.out" 2>&1 &
holder=$!
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -e "$state/lock-removed" ] && break
sleep 0.05
done
Expand Down Expand Up @@ -190,7 +190,7 @@ t7_orphan_baseline_is_published_before_reclaim_handoff() {
printf '%s\n' "$?" > "$state/reclaimer.rc"
) &
reclaimer=$!
for _ in $(seq 1 100); do
for _ in $(seq 1 600); do
[ -e "$state/publishing" ] && break
sleep 0.05
done
Expand Down
4 changes: 1 addition & 3 deletions tests/shared-git-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,4 @@ SUB_RC=$(cat "$D/sub-rc.txt" 2>/dev/null)
N=$(mktemp -d); F=$(cd "$N" && bash -c "set -uo pipefail; . '$LIB'; write_lock_path"); rm -rf "$N"
case "$F" in */.maestro-write.lock) ;; *) echo "VERIFY FAIL: non-git fallback = $F"; exit 1;; esac

[ -f "$ROOT/tests/lease.sh" ] || { echo "VERIFY FAIL: missing $ROOT/tests/lease.sh"; exit 1; }
bash "$ROOT/tests/lease.sh" 2>&1 | tail -1 | grep -qE '[1-9][0-9]* passed, 0 failed' || { echo "VERIFY FAIL: lease suite regressed"; exit 1; }
echo "VERIFY PASS: shared worktree/submodule lease path, contention=11, fallback intact, lease suite green"
echo "VERIFY PASS: shared worktree/submodule lease path, contention=11, fallback intact"