From 086d7eafc44fc6d06232363ce490ed2dd513a1ea Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 8 May 2024 13:45:02 +1000 Subject: [PATCH] compose: mariadb -> service_healthy MARIADB_ALLOW_EMPTY_PASSWORD isn't a variable recognised by the MariaDB container, and MARIADB_ALLOW_EMPTY_ROOT_PASSWORD is a bit false when we set a password. Also use MariaDB's healthcheck script to ensure the service is healthy before running tests. There is other mechanisms to enforce this, but lets be clear at the basic level of the healthcheck.sh script maintained in the container (currently by me). --- docker-compose.test-mariadb.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docker-compose.test-mariadb.yml b/docker-compose.test-mariadb.yml index 832a4594f..1bfb205eb 100644 --- a/docker-compose.test-mariadb.yml +++ b/docker-compose.test-mariadb.yml @@ -41,9 +41,12 @@ services: - TWD_HOST=selenium - TWD_PORT=4444 depends_on: - - bugzilla6.mariadb106 - - memcached - - selenium + memcached: + condition: service_started + selenium: + condition: service_started + bugzilla6.mariadb106: + condition: service_healthy bugzilla6.mariadb106: image: mariadb:10.6 @@ -56,7 +59,12 @@ services: - MARIADB_ROOT_PASSWORD=bugs - MARIADB_USER=bugs - MARIADB_PASSWORD=bugs - - MARIADB_ALLOW_EMPTY_PASSWORD=1 + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 memcached: image: memcached:latest