From b3dd19d436dc03411bae4431e9cb1140cf39d349 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Tue, 8 Oct 2024 17:47:42 +0100 Subject: [PATCH] Tests: Wait for the minio-server to initialize before using it This should help fix flakiness we're seeing with webresources where tests fail because we try to create the bucket before the minio server has initialized and therefore it causes test failures. This also adds a `set -e` so that if the command does still fail it should fail fast rather than after trying to run all the tests, and make it clearer where the error actually originates from Change-type: patch --- docker-compose.test-custom.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.test-custom.yml b/docker-compose.test-custom.yml index d8933cb9e..707789647 100644 --- a/docker-compose.test-custom.yml +++ b/docker-compose.test-custom.yml @@ -38,6 +38,11 @@ services: entrypoint: > /bin/sh -c " set -e; + + while ! curl -I minio-server:9000/minio/health/live; do + sleep 1; + done + /usr/bin/mc config host add minio-server http://minio-server:9000 USERNAME PASSWORD; /usr/bin/mc mb --ignore-existing minio-server/balena-pine-web-resources; sleep infinity;