test(gate): poll immich lan_address to absorb mid-recreate churn

5× run #4 flaked iter4 on "immich exposes its web UI lan-address
(port 2283)": container-list returned lan_address=null because
immich_server was momentarily mid-recreate when the read-only tier
queried it (passed the other 4 iterations; immich_server does publish
0.0.0.0:2283->2283). Same single-shot-read class as the bitcoin-knots
state probe — poll <=30s for the exposed port instead of one read. A
genuinely unexposed immich never publishes 2283, so real port drift
is still caught.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-06-23 03:20:18 -04:00
parent 6511754545
commit 2afd18c6de

View File

@ -47,9 +47,23 @@ teardown_file() {
} }
@test "immich exposes its web UI lan-address (port 2283)" { @test "immich exposes its web UI lan-address (port 2283)" {
run rpc_result container-list # Poll briefly: lan_address is derived from the published host port, which is
[ "$status" -eq 0 ] # momentarily absent (null) while immich_server is mid-recreate (e.g. a
echo "$output" | jq -e '.[] | select(.name == "immich") | .lan_address | test("2283")' >/dev/null # health-monitor bounce during the read-only tier). A genuinely unexposed
# immich never publishes 2283, so this still catches real port drift; it only
# absorbs the transient null seen under churn.
local deadline=$(( $(date +%s) + 30 ))
while (( $(date +%s) < deadline )); do
run rpc_result container-list
[ "$status" -eq 0 ]
if echo "$output" \
| jq -e '.[] | select(.name == "immich") | .lan_address // "" | test("2283")' >/dev/null; then
return 0
fi
sleep 3
done
echo "immich never reported a lan_address containing 2283 within 30s" >&2
return 1
} }
# ──────────────────────────────────────────────────────────────────── # ────────────────────────────────────────────────────────────────────