From ab804c678afc90dd8ec7e19b67c50c398f6d4324 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 29 Apr 2026 08:19:54 -0400 Subject: [PATCH] test: assert dead-images grep result instead of count The previous assertion piped grep -c through `|| echo 0`, which printed an extra `0` when the file existed without matches because grep -c emits the count of `0` and exits 1, triggering the fallback. --- tests/unit/scheduler-docker-local.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/scheduler-docker-local.bats b/tests/unit/scheduler-docker-local.bats index d51d86ae9..88bafef00 100644 --- a/tests/unit/scheduler-docker-local.bats +++ b/tests/unit/scheduler-docker-local.bats @@ -298,10 +298,10 @@ teardown() { assert_success assert_output_contains "has running containers, skipping rm" 0 - run /bin/bash -c "test -f /var/lib/dokku/data/scheduler-docker-local/dead-images && grep -c \"$running_image\" /var/lib/dokku/data/scheduler-docker-local/dead-images || echo 0" + run /bin/bash -c "grep -F \"$running_image\" /var/lib/dokku/data/scheduler-docker-local/dead-images 2>/dev/null || true" echo "output: $output" echo "status: $status" - assert_output "0" + assert_output "" run /bin/bash -c "docker container inspect $TEST_APP.web.1 --format '{{.State.Status}}'" echo "output: $output"