Let a job choose its AMS slot; soak test for telemetry

POST /jobs takes an optional amsSlot (stored in the job metadata) which
dispatch passes to the gateway. The camera e2e script gains SOAK_S.
This commit is contained in:
2026-10-30 06:56:24 +00:00
parent 58d5b013bc
commit fcde6f5155
4 changed files with 22 additions and 1 deletions
+13
View File
@@ -148,6 +148,19 @@ if grep -qi 'access_code\|accessCode' "$WORK/backend.log"; then
fi
ok "the backend log never mentions an access code"
# Optional soak: the first real dispatch froze the proxy ~4.5 min in (an
# MQTT publish that never completed while the fleet lock was held). Staying
# connected well past that and still receiving telemetry is the regression test.
if [ -n "${SOAK_S:-}" ]; then
echo "==> soaking for ${SOAK_S}s: telemetry must keep arriving"
sleep "$SOAK_S"
AGE="$(psql_q "SELECT extract(epoch FROM now() - last_seen_at)::int FROM printers WHERE id='$CAM_UUID'")"
[ -n "$AGE" ] && [ "$AGE" -lt 20 ] || fail "telemetry is ${AGE:-never}s old after the soak - the proxy froze"
ok "telemetry still fresh (${AGE}s old) after ${SOAK_S}s"
code="$(fetch "$WORK/after.jpg")"; [ "$code" = 200 ] || fail "no camera frame after the soak: HTTP $code"
ok "camera still answers after the soak"
fi
[ -n "$SAVE_FRAME" ] && cp "$WORK/f2.jpg" "$SAVE_FRAME" && ok "kept a frame at $SAVE_FRAME"
echo
echo "PASS - a P1/A1 camera frame travelled printer -> proxy -> backend -> an authenticated viewer."