Skip to content

Commit 5299d73

Browse files
committed
fix(ci): repair MySQL healthcheck so dependents wait for it properly
Exec-form healthcheck did not shell-expand $$MYSQL_USER and $$MYSQL_PASSWORD, so mysqladmin received literal '$MYSQL_USER' as the username. mysqladmin ping reports 'mysqld is alive' on connection errors via stderr while still exiting non-zero with bad credentials, making the check unstable and CI flakes (Adapter Tests SharedTables/MySQL) appear with all tests failing on Connection refused before MySQL was actually ready. Switch to CMD-SHELL so the env vars expand at run time, ping over TCP on the configured port, and use root/MYSQL_ROOT_PASSWORD which is always set.
1 parent b8e383c commit 5299d73

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ services:
189189
cap_add:
190190
- SYS_NICE
191191
healthcheck:
192-
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u $$MYSQL_USER", "-p $$MYSQL_PASSWORD"]
192+
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -P $$MYSQL_TCP_PORT -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
193193
interval: 10s
194194
timeout: 5s
195195
retries: 5
@@ -211,7 +211,7 @@ services:
211211
cap_add:
212212
- SYS_NICE
213213
healthcheck:
214-
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u $$MYSQL_USER", "-p $$MYSQL_PASSWORD"]
214+
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -P $$MYSQL_TCP_PORT -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
215215
interval: 10s
216216
timeout: 5s
217217
retries: 5

0 commit comments

Comments
 (0)