From c4f33692c9fcadf5ff91bd14f22e77788ecc8471 Mon Sep 17 00:00:00 2001 From: Peter Opatril Date: Mon, 23 Sep 2024 23:13:44 +0200 Subject: [PATCH] test: fix waiting for mysql container start --- tests/runtest.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/runtest.sh b/tests/runtest.sh index b39b0a2..343a323 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -13,6 +13,10 @@ TEST_MYSQL_DOCKER_IMAGE="${TEST_MYSQL_DOCKER_IMAGE:-mysql:8.0.39-debian}" docker build --pull --tag=${IMAGE_NAME} --build-arg=TEST_MYSQL_DOCKER_IMAGE="${TEST_MYSQL_DOCKER_IMAGE}" db docker rm --force ${CONTAINER_NAME} >/dev/null 2>&1 || true docker run --detach --publish-all --name ${CONTAINER_NAME} ${IMAGE_NAME} +while [ -z "$(docker inspect --format='{{.NetworkSettings.IPAddress}}' ${CONTAINER_NAME})" ]; do + echo "Waiting for container ${CONTAINER_NAME} to start ..." + sleep 1 +done MYSQL_HOST=`docker inspect --format='{{.NetworkSettings.IPAddress}}' ${CONTAINER_NAME}` set +e