From 4bfd3ba7adbb508c3af0caa0f575528e8c0468c1 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Tue, 10 Nov 2026 22:05:39 +0000 Subject: [PATCH] ci: clear stale qBittorrent container in e2e The e2e job never removed its fixed-name qBittorrent container, so every run since late August failed on the name conflict. Remove a leftover first, tear down on any outcome, and serialise runs. The config is now copied in rather than bind-mounted, since the bind path is resolved on the runner host, not in the job container. Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitea/workflows/e2e.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/e2e.yml b/.gitea/workflows/e2e.yml index 90c0163..fe0a090 100644 --- a/.gitea/workflows/e2e.yml +++ b/.gitea/workflows/e2e.yml @@ -18,6 +18,12 @@ on: - 'crates/arr-daemon/**' - '.gitea/workflows/e2e.yml' +# The qBittorrent container below has a fixed name and binds the runner host's +# port 8080, so two runs at once would trip over each other. +concurrency: + group: arr-e2e + cancel-in-progress: false + env: CARGO_TERM_COLOR: always CARGO_PROFILE_DEV_DEBUG: "0" @@ -77,7 +83,13 @@ jobs: # variable for the WebUI password and prints a random one per boot, # so the only scriptable login is a config seeded before first start, # which a service container cannot be given. + # + # `docker` here talks to the runner host's daemon, so a bind mount + # would name a host path this job never wrote. The config is copied + # in instead. A container left by a run that died before teardown is + # removed first; the name is fixed, so it would block every run after. run: | + docker rm -f arr-e2e-qbittorrent >/dev/null 2>&1 || true mkdir -p /tmp/qbt/config/qBittorrent cat > /tmp/qbt/config/qBittorrent/qBittorrent.conf <<'CONF' [Preferences] @@ -88,14 +100,18 @@ jobs: WebUI\HostHeaderValidation=false Downloads\SavePath=/downloads CONF - docker run -d --name arr-e2e-qbittorrent --network host \ + docker create --name arr-e2e-qbittorrent --network host \ -e PUID=1000 -e PGID=1000 -e WEBUI_PORT=8080 \ - -v /tmp/qbt/config:/config \ linuxserver/qbittorrent:latest + docker cp /tmp/qbt/config/. arr-e2e-qbittorrent:/config/ + docker start arr-e2e-qbittorrent for _ in $(seq 1 60); do - curl -sf http://127.0.0.1:8080/api/v2/app/version && break + curl -sf http://127.0.0.1:8080/api/v2/app/version && exit 0 sleep 2 done + echo "qBittorrent never answered" >&2 + docker logs arr-e2e-qbittorrent >&2 || true + exit 1 - name: build daemon # The harness spawns this binary; building it here keeps the compile @@ -107,3 +123,7 @@ jobs: env: QBITTORRENT_URL: http://127.0.0.1:8080 run: cargo nextest run -p arr-e2e + + - name: stop qBittorrent + if: always() + run: docker rm -f arr-e2e-qbittorrent >/dev/null 2>&1 || true