From 3a2760d2decff7a03ed9ad20f14551f62ec4296d Mon Sep 17 00:00:00 2001 From: Cris Dywa Date: Wed, 11 May 2022 13:34:47 +0200 Subject: [PATCH] Retry setting up the postgres container Fixes: https://progress.opensuse.org/issues/110803 --- tests/containers/setup_env.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/containers/setup_env.pm b/tests/containers/setup_env.pm index afd6b68e..fd78c9a5 100644 --- a/tests/containers/setup_env.pm +++ b/tests/containers/setup_env.pm @@ -7,7 +7,7 @@ sub run { assert_script_run("mkdir -p /root/data/factory/{iso,hdd,other} /root/data/tests"); assert_script_run("docker network create testing"); - assert_script_run("docker run --rm -d --network testing -e POSTGRES_PASSWORD=openqa -e POSTGRES_USER=openqa -e POSTGRES_DB=openqa --net-alias=db --name db postgres", timeout => 600); + assert_script_run("for i in {1..3}; do docker run --rm -d --network testing -e POSTGRES_PASSWORD=openqa -e POSTGRES_USER=openqa -e POSTGRES_DB=openqa --net-alias=db --name db postgres && break; done", timeout => 600); wait_for_container_log("db", "database system is ready to accept connections", "docker"); }