From 2afd18c6de2c75a10b83b7b848b058ecf4043e9b Mon Sep 17 00:00:00 2001 From: archipelago Date: Tue, 23 Jun 2026 03:20:18 -0400 Subject: [PATCH] test(gate): poll immich lan_address to absorb mid-recreate churn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- tests/lifecycle/bats/immich.bats | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/lifecycle/bats/immich.bats b/tests/lifecycle/bats/immich.bats index b3779875..fec60fab 100644 --- a/tests/lifecycle/bats/immich.bats +++ b/tests/lifecycle/bats/immich.bats @@ -47,9 +47,23 @@ teardown_file() { } @test "immich exposes its web UI lan-address (port 2283)" { - run rpc_result container-list - [ "$status" -eq 0 ] - echo "$output" | jq -e '.[] | select(.name == "immich") | .lan_address | test("2283")' >/dev/null + # Poll briefly: lan_address is derived from the published host port, which is + # momentarily absent (null) while immich_server is mid-recreate (e.g. a + # 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 } # ────────────────────────────────────────────────────────────────────