From 494a1ae089c66fe183ee5a1f4f38e5d725063e77 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Mon, 1 May 2023 12:11:15 +0100 Subject: [PATCH] Report on container health after failure --- test/integration/deploy_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/deploy_test.rb b/test/integration/deploy_test.rb index 89b2269f..0fb94d27 100644 --- a/test/integration/deploy_test.rb +++ b/test/integration/deploy_test.rb @@ -61,7 +61,10 @@ class DeployTest < ActiveSupport::TestCase def wait_for_healthy(timeout: 20) timeout_at = Time.now + timeout while docker_compose("ps -a | tail -n +2 | grep -v '(healthy)' | wc -l", capture: true) != "0" - raise "Container not healthy after #{timeout} seconds" if timeout_at < Time.now + if timeout_at < Time.now + docker_compose("ps -a | tail -n +2 | grep -v '(healthy)'") + raise "Container not healthy after #{timeout} seconds" if timeout_at < Time.now + end sleep 0.1 end end