File tree 1 file changed +3
-1
lines changed
misk-vitess/src/testFixtures/kotlin/misk/vitess/testing/internal
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ internal class VitessDockerContainer(
59
59
const val READONLY_COUNT =
60
60
- 1 // Set to -1 to actually set the read-only count to 0. This overrides a defaults issue in the vtcombo codebase.
61
61
62
+ const val DOCKER_HEALTH_CHECK_HOST = " localhost"
62
63
const val DOCKER_START_RETRIES = 6
63
64
const val DOCKER_START_RETRY_DELAY_MS = 5000L
64
65
const val CONTAINER_START_RETRIES = 10
@@ -338,12 +339,13 @@ internal class VitessDockerContainer(
338
339
! debugStartup // If `debugStartup` is `true`, we keep the container running to inspect logs.
339
340
) // Otherwise, remove container when it stops.
340
341
342
+ // The health check is run from the Docker daemon, so it needs to target localhost.
341
343
val healthCheck =
342
344
HealthCheck ()
343
345
.withTest(
344
346
listOf (
345
347
" CMD-SHELL" ,
346
- " mysql -h ${vitessClusterConfig.hostname} --protocol=tcp -P ${vitessClusterConfig.vtgatePort} -u=${vitessClusterConfig.vtgateUser} --execute 'USE @primary;'" ,
348
+ " mysql -h $DOCKER_HEALTH_CHECK_HOST --protocol=tcp -P ${vitessClusterConfig.vtgatePort} -u=${vitessClusterConfig.vtgateUser} --execute 'USE @primary;'" ,
347
349
)
348
350
)
349
351
.withInterval(Duration .ofSeconds(CONTAINER_HEALTH_CHECK_INTERVAL_SECONDS ).toNanos())
You can’t perform that action at this time.
0 commit comments