File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
misk-vitess/src/testFixtures/kotlin/misk/vitess/testing/internal Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -259,14 +259,7 @@ internal class VitessDockerContainer(
259259 // If we are here, we likely obtained a vttestserver start-up error.
260260 if (statusCode != 0 ) {
261261 if (debugStartup) {
262- val logCallback = LogContainerResultCallback ()
263- dockerClient
264- .logContainerCmd(containerId)
265- .withStdOut(true )
266- .withStdErr(true )
267- .exec(logCallback)
268- .awaitCompletion()
269- println (" Container start up logs:\n ${logCallback.getLogs()} " )
262+ emitStartupLogs(containerId)
270263 throw VitessTestDbStartupException (" Failed to start Docker container for `$containerName `." )
271264 }
272265 throw VitessTestDbStartupException (
@@ -286,12 +279,24 @@ internal class VitessDockerContainer(
286279 retryCount++
287280 if (retryCount == CONTAINER_START_RETRIES ) {
288281 println (" Failed to start Docker container for `$containerName ` after max retries." )
282+ emitStartupLogs(containerId)
289283 throw VitessTestDbStartupException (" Container health check failed after `$CONTAINER_START_RETRIES ` attempts." )
290284 }
291285 }
292286 }
293287 }
294288
289+ private fun emitStartupLogs (containerId : String ) {
290+ val logCallback = LogContainerResultCallback ()
291+ dockerClient
292+ .logContainerCmd(containerId)
293+ .withStdOut(true )
294+ .withStdErr(true )
295+ .exec(logCallback)
296+ .awaitCompletion()
297+ println (" Container start up logs:\n ${logCallback.getLogs()} " )
298+ }
299+
295300 private fun getContainerHealthStatus (containerId : String ): String {
296301 val healthStatus: String
297302 try {
You can’t perform that action at this time.
0 commit comments