From 6f2c1d8492c8a8f06aecf615c092a50712acd885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Wed, 22 Jul 2026 22:09:22 +0200 Subject: [PATCH] ci(forgejo): robust BRouter segment seed + longer routing warmup (e2e) - verify the segment download is non-empty (retry x3); brouter.de is flaky and a silent empty download surfaced only as a 240s routing timeout. - bump routing readiness wait 120s->240s (segment load on a busy runner). Co-Authored-By: Claude Opus 4.8 (1M context) --- .forgejo/workflows/ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 151f50f..7002b67 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -214,10 +214,19 @@ jobs: # container — a job-side download + bind mount would not be visible to # the DinD daemon (separate filesystem). Project name pinned to `trails` # so the volume matches docker-compose.dev.yml's `brouter_segments`. + # Verify the download is non-empty (brouter.de can be flaky) so a bad + # segment fails here rather than as a mysterious routing timeout later. run: | docker volume create trails_brouter_segments - docker run --rm -v trails_brouter_segments:/dst alpine sh -c \ - "wget -q https://brouter.de/brouter/segments4/E10_N50.rd5 -O /dst/E10_N50.rd5 && chmod a+r /dst/*.rd5" + docker run --rm -v trails_brouter_segments:/dst alpine sh -c ' + set -e + for a in 1 2 3; do + wget -q https://brouter.de/brouter/segments4/E10_N50.rd5 -O /dst/E10_N50.rd5 && break + echo "segment download attempt $a failed; retrying"; sleep 5 + done + test -s /dst/E10_N50.rd5 + chmod a+r /dst/*.rd5 + ls -la /dst' - name: Start services run: docker compose -p trails -f docker-compose.dev.yml up -d --wait --build postgres brouter @@ -226,9 +235,9 @@ jobs: - name: Wait for BRouter routing run: | - for i in $(seq 1 60); do + for i in $(seq 1 120); do curl -s 'http://host.docker.internal:17777/brouter?lonlats=13.4,52.5|13.5,52.5&profile=trekking&format=geojson' 2>/dev/null | grep -q "FeatureCollection" && echo "BRouter ready" && break - [ "$i" = "60" ] && echo "BRouter not ready after 120s" && exit 1 + [ "$i" = "120" ] && echo "BRouter not ready after 240s" && exit 1 sleep 2 done