Skip to content

Remove space from MySQL healthcheck default options#85

Merged
guilleiguaran merged 1 commit intotestcontainers:mainfrom
Thomascountz:thomascountz/fix_default_healthchecks_for_podman
Sep 3, 2025
Merged

Remove space from MySQL healthcheck default options#85
guilleiguaran merged 1 commit intotestcontainers:mainfrom
Thomascountz:thomascountz/fix_default_healthchecks_for_podman

Conversation

@Thomascountz
Copy link
Copy Markdown
Contributor

@Thomascountz Thomascountz commented Jun 26, 2025

Fixes an issue caused by a bug in Podman. Arguments with spaces in healthchecks are incorrectly parsed and executed, which causes MySQL TestContainers with default healthchecks to never become healthy.

See: containers/podman#26519

podman inspect healthcheck-test-mysql | jq '.[].Config.Healthcheck'
--- healthcheck_bug.json	2025-06-26 12:12:35
+++ healthcheck_fix.json	2025-06-26 12:12:27
@@ -3,7 +3,8 @@
     "CMD",
     "/usr/bin/mysql",
    "--protocol=TCP",
    "--port=3306",
    "--user=xxx",
    "--password=xxx",
    "healthcheck_test",
    "--silent",
-    "--execute=SELECT",
-    "1;"
+    "--execute=SELECT(1);"
   ],
   "Interval": 1000000000,
   "Timeout": 5000000000,
  "Retries": 5
}

Arguments with spaces in healthchecks are incorrectly parsed in Podman.

See: containers/podman#26519
@Thomascountz Thomascountz changed the title Update MySQL healthcheck query syntax in default options Remove space from MySQL healthcheck default options Jun 27, 2025
@guilleiguaran guilleiguaran merged commit 36b2313 into testcontainers:main Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants