Skip to content

Commit f492767

Browse files
committed
test(mysql2): Harden tracing-channel healthcheck to fix flaky CI
The suite gated readiness on `mysqladmin ping`, which reports "alive" even during MySQL 8's init bootstrap (it treats access-denied as alive). So `docker compose up --wait` could return before the real server and root password were ready, and the scenario's first connection was dropped ("server closed the connection") — crashing the run and timing out the test. Gate on an authenticated `SELECT 1` instead, mirroring the knex/mysql2 sibling suite (#21868).
1 parent 742dda3 commit f492767

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • dev-packages/node-integration-tests/suites/tracing/mysql2-tracing-channel

dev-packages/node-integration-tests/suites/tracing/mysql2-tracing-channel/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ services:
88
environment:
99
MYSQL_ROOT_PASSWORD: password
1010
healthcheck:
11-
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -uroot -ppassword']
11+
# `mysqladmin ping` reports "alive" even during MySQL's init bootstrap (it treats
12+
# access-denied as alive), so `--wait` can return before the real server and root
13+
# password are ready, and early connections get dropped ("server closed the
14+
# connection"). Run an authenticated query instead so readiness gates on the real server.
15+
test: ['CMD-SHELL', 'mysql -h 127.0.0.1 -uroot -ppassword -e "SELECT 1"']
1216
interval: 2s
1317
timeout: 3s
1418
retries: 30

0 commit comments

Comments
 (0)