File tree 1 file changed +13
-8
lines changed
misk-vitess/src/testFixtures/kotlin/misk/vitess/testing/internal
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -259,14 +259,7 @@ internal class VitessDockerContainer(
259
259
// If we are here, we likely obtained a vttestserver start-up error.
260
260
if (statusCode != 0 ) {
261
261
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)
270
263
throw VitessTestDbStartupException (" Failed to start Docker container for `$containerName `." )
271
264
}
272
265
throw VitessTestDbStartupException (
@@ -286,12 +279,24 @@ internal class VitessDockerContainer(
286
279
retryCount++
287
280
if (retryCount == CONTAINER_START_RETRIES ) {
288
281
println (" Failed to start Docker container for `$containerName ` after max retries." )
282
+ emitStartupLogs(containerId)
289
283
throw VitessTestDbStartupException (" Container health check failed after `$CONTAINER_START_RETRIES ` attempts." )
290
284
}
291
285
}
292
286
}
293
287
}
294
288
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
+
295
300
private fun getContainerHealthStatus (containerId : String ): String {
296
301
val healthStatus: String
297
302
try {
You can’t perform that action at this time.
0 commit comments