From c6ac496023c6dda3c197198de6dd6d5002a5f7f8 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/containers/setup_env.pm b/tests/containers/setup_env.pm index afd6b68e..1475f82d 100644 --- a/tests/containers/setup_env.pm +++ b/tests/containers/setup_env.pm @@ -6,9 +6,9 @@ sub run { my ($self) = @_; 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); - wait_for_container_log("db", "database system is ready to accept connections", "docker"); + assert_script_run("podman network create testing"); + assert_script_run("for i in {1..3}; do podman run --rm -d --network testing -e POSTGRES_PASSWORD=openqa -e POSTGRES_USER=openqa -e POSTGRES_DB=openqa --network-alias=db --name db docker.io/library/postgres:latest && break; done", timeout => 600); + wait_for_container_log("db", "database system is ready to accept connections", "podman"); } 1;