Report on container health after failure

This commit is contained in:
Donal McBreen
2023-05-01 12:11:15 +01:00
parent a77428143f
commit 494a1ae089

View File

@@ -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