test/fixture-claude.sh
#!/bin/bash
set -u
state_dir="${FIXTURE_STATE_DIR:?}"
count_file="$state_dir/count"
count=0
[ ! -f "$count_file" ] || count="$(cat "$count_file")"
count=$((count + 1))
printf '%s\n' "$count" >"$count_file"
printf '%s\n' "pid=$$ run=$count" >>"$state_dir/children.log"
if [ "$count" -le 3 ]; then
printf '%s\n' 'Error: 429 too many requests — rate limit'
exit 1
fi
printf '%s\n' 'fixture completed successfully'
exit 0