Skip to content

Commit 1243eed

Browse files
committed
test/e2e: Fail if containers are still running
Signed-off-by: Stefan Büringer [email protected]
1 parent 0119de7 commit 1243eed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/ci-e2e.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ cleanup() {
8686
ctr -n moby containers list > "${ARTIFACTS_LOCAL}/containerd-containers.txt" || true
8787
ctr -n moby images list > "${ARTIFACTS_LOCAL}/containerd-images.txt" || true
8888
ctr -n moby version > "${ARTIFACTS_LOCAL}/containerd-version.txt" || true
89+
90+
# Verify that no containers are running at this time
91+
# Note: This verifies that all our tests clean up clusters correctly.
92+
if [[ ! "$(docker ps -q | wc -l)" -eq "0" ]]
93+
then
94+
echo "ERROR: Found unexpected running containers:"
95+
echo ""
96+
docker ps
97+
exit 1
98+
fi
8999
}
90100
trap "cleanup" EXIT SIGINT
91101

0 commit comments

Comments
 (0)