From 0355b1cd99c3f030ec638685a165ca55cc424adc Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 6 Sep 2026 10:35:08 +0200 Subject: [PATCH] =?UTF-8?q?ci(test):=20purge=20aussi=20les=20conteneurs=20?= =?UTF-8?q?`postgres-*`=20orphelins=20au=20d=C3=A9marrage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les essais 1-2 de cette branche (nom de conteneur Postgres par run) ont laissé des conteneurs `postgres-122` / `postgres-125` en marche sur le runner persistant : leur teardown `if: always()` n'a pas tourné (ce runner saute les étapes finales après un échec) et rien d'autre ne cible ce préfixe. Un 2e Postgres inactif affame la RAM du runner → requêtes ~5× plus lentes → `resetDatabase()` dépasse le timeout Mocha. L'étape « Start Postgres » retire maintenant tout `postgres-*` en plus du `postgres` nu ; plus rien ne crée ce préfixe, donc ça ne touche que ces résidus. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efdd8d9..686d245 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,6 +132,15 @@ jobs: | awk '{print $1}')" echo "job network: ${net:?could not determine the job container network}" docker rm -f postgres >/dev/null 2>&1 || true + # Also drop any `postgres-` container. A since-reverted + # attempt at per-run Postgres naming on this branch left some + # running on this persistent runner (their `if: always()` teardown + # never fired — this runner skips trailing steps after a failure), + # and nothing else removes them. A second idle Postgres here starves + # the runner's RAM and slows every query ~5x → `resetDatabase()` + # blows Mocha's 10s hook timeout. Nothing creates `postgres-*` any + # more, so this only ever clears that debris. + docker ps -aq --filter 'name=^postgres-' | xargs -r docker rm -f >/dev/null 2>&1 || true docker run -d --name postgres --network "$net" \ -e POSTGRES_USER=ci -e POSTGRES_PASSWORD=ci -e POSTGRES_DB=batchcooking_ci \ postgres:16-alpine