From cabcb81d49e7fecaf101ed9b1493b93b0206cd7f Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 23 Oct 2026 06:06:03 -0500 Subject: [PATCH] row 305 (#1812): each suite's network check also requires the network present under the run's project before the remove (mos-1445) --- scripts/test-release.sh | 14 +++++++++----- scripts/test-task.sh | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/scripts/test-release.sh b/scripts/test-release.sh index 2179a50f6..2a9187bdb 100755 --- a/scripts/test-release.sh +++ b/scripts/test-release.sh @@ -123,12 +123,16 @@ else echo "skip state-machine cases (docker daemon unavailable)" fi -# The compose network goes with the run (row 305): the trap's cleanup leaves no -# network under this run's project name. +# The compose network goes with the run (row 305). Present before the remove +# proves compose used this run's project name; absent after proves the trap's +# cleanup removes it (mos-1445). if docker info >/dev/null 2>&1; then - remove_compose_network - NETS="$(docker network ls -q --filter "name=^${COMPOSE_PROJECT_NAME}_default\$")" && [ -z "$NETS" ] \ - && check "compose network removed after the run" 0 || check "compose network removed after the run" 1 + NET="${COMPOSE_PROJECT_NAME}_default" + BEFORE="$(docker network ls -q --filter "name=^${NET}\$")" && [ -n "$BEFORE" ] \ + && remove_compose_network \ + && AFTER="$(docker network ls -q --filter "name=^${NET}\$")" && [ -z "$AFTER" ] \ + && check "compose network made under the run's project and removed after the run" 0 \ + || check "compose network made under the run's project and removed after the run" 1 else echo "skip compose network check (docker daemon unavailable)" fi diff --git a/scripts/test-task.sh b/scripts/test-task.sh index ac65dbbb8..2a9f8b9eb 100755 --- a/scripts/test-task.sh +++ b/scripts/test-task.sh @@ -573,12 +573,16 @@ fi git -C "$SANDBOX/repo" rev-parse >/dev/null 2>&1 || true unset MOSAIC_CONFIG -# The compose network goes with the run (row 305): the trap's cleanup leaves no -# network under this run's project name. +# The compose network goes with the run (row 305). Present before the remove +# proves compose used this run's project name; absent after proves the trap's +# cleanup removes it (mos-1445). if docker info >/dev/null 2>&1; then - remove_compose_network - NETS="$(docker network ls -q --filter "name=^${COMPOSE_PROJECT_NAME}_default\$")" && [ -z "$NETS" ] \ - && check "compose network removed after the run" 0 || check "compose network removed after the run" 1 + NET="${COMPOSE_PROJECT_NAME}_default" + BEFORE="$(docker network ls -q --filter "name=^${NET}\$")" && [ -n "$BEFORE" ] \ + && remove_compose_network \ + && AFTER="$(docker network ls -q --filter "name=^${NET}\$")" && [ -z "$AFTER" ] \ + && check "compose network made under the run's project and removed after the run" 0 \ + || check "compose network made under the run's project and removed after the run" 1 else echo "skip compose network check (docker daemon unavailable)" fi