Skip to content

Commit f21c3ad

Browse files
committed
Build/Test Tools: Check database readiness over TCP.
Merges r59484, r59489, and r63871 to the 5.5 branch. Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch. Developed in: #13737 Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj. See #66117. git-svn-id: https://develop.svn.wordpress.org/branches/5.5@65455 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3c5160d commit f21c3ad

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎docker-compose.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ services:
8181
# For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
8282
command: --default-authentication-plugin=mysql_native_password
8383

84+
# Ping over TCP: the client resolves the literal `localhost` to the Unix socket, which the
85+
# temporary `--skip-networking` server used to initialise a cold volume answers long before
86+
# the real server listens on port 3306.
8487
healthcheck:
85-
test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ]
88+
test: [
89+
'CMD-SHELL',
90+
'if [ "$LOCAL_DB_TYPE" = "mariadb" ]; then case "$LOCAL_DB_VERSION" in 5.5|10.0|10.1|10.2|10.3) mysqladmin ping -h 127.0.0.1 --protocol=tcp || exit $$?;; *) mariadb-admin ping -h 127.0.0.1 --protocol=tcp || exit $$?;; esac; else mysqladmin ping -h 127.0.0.1 --protocol=tcp || exit $$?; fi'
91+
]
8692
timeout: 5s
8793
interval: 5s
8894
retries: 10

0 commit comments

Comments
 (0)