From 19e91168030af3deb6b503c61579363aff58f8a0 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Fri, 6 Jan 2023 12:57:55 +0100 Subject: [PATCH] Add back docker healthcheck on services I saw in the GHA logs that it perform an healtcheck ! So I hope this will work. --- .github/workflows/ansible-test-plugins.yml | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ansible-test-plugins.yml b/.github/workflows/ansible-test-plugins.yml index c7ce7f4..f004810 100644 --- a/.github/workflows/ansible-test-plugins.yml +++ b/.github/workflows/ansible-test-plugins.yml @@ -89,6 +89,16 @@ jobs: MYSQL_ROOT_PASSWORD: msandbox ports: - 3307:3306 + # We write our own health-cmd because the mariadb container does not + # provide a healthcheck + options: >- + --health-cmd "mysqladmin ping -P 3306 -pmsandbox" + | grep alive + || exit 1 + --health-start-period 10s + --health-interval 10s + --health-timeout 5s + --health-retries 6 db_replica1: image: ${{ matrix.db_engine_version }} @@ -99,6 +109,14 @@ jobs: - 3308:3306 volumes: - ${{ github.workspace }}/tests/integration/setup_mysql/replica1/:/etc/mysql/conf.d/ + options: >- + --health-cmd "mysqladmin ping -P 3306 -pmsandbox" + | grep alive + || exit 1 + --health-start-period 10s + --health-interval 10s + --health-timeout 5s + --health-retries 6 db_replica2: image: ${{ matrix.db_engine_version }} @@ -109,11 +127,16 @@ jobs: - 3309:3306 volumes: - ${{ github.workspace }}/tests/integration/setup_mysql/replica2/:/etc/mysql/conf.d/ + options: >- + --health-cmd "mysqladmin ping -P 3306 -pmsandbox" + | grep alive + || exit 1 + --health-start-period 10s + --health-interval 10s + --health-timeout 5s + --health-retries 6 steps: - - name: 'Wait 20s for the service containers to be healthy' - run: - sleep 20; - name: >- Perform integration testing against