Skip to content

Commit 0552aa1

Browse files
committed
svn commit
Build/Test Tools: Check database readiness over TCP. Merges r59484, r59489, and r63871 to the 5.8 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: #13740 Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj. See #66117. git-svn-id: https://develop.svn.wordpress.org/branches/5.8@65452 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ae87622 commit 0552aa1

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
@@ -80,8 +80,14 @@ services:
8080
# For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
8181
command: --default-authentication-plugin=mysql_native_password
8282

83+
# Ping over TCP: the client resolves the literal `localhost` to the Unix socket, which the
84+
# temporary `--skip-networking` server used to initialise a cold volume answers long before
85+
# the real server listens on port 3306.
8386
healthcheck:
84-
test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ]
87+
test: [
88+
'CMD-SHELL',
89+
'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'
90+
]
8591
timeout: 5s
8692
interval: 5s
8793
retries: 10

0 commit comments

Comments
 (0)