Skip to content

Commit 49a103c

Browse files
authored
Improve logging in InternalCommandPortListeningCheck (#3001)
1 parent 3a6e77e commit 49a103c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public Boolean call() {
4141
try {
4242
ExecResult result = ExecInContainerPattern.execInContainer(waitStrategyTarget.getContainerInfo(), "/bin/sh", "-c", command.toString());
4343
log.trace("Check for {} took {}. Result code '{}', stdout message: '{}'", internalPorts, Duration.between(before, Instant.now()), result.getExitCode(), result.getStdout());
44-
return result.getExitCode() == 0;
44+
int exitCode = result.getExitCode();
45+
if (exitCode != 0 && exitCode != 1) {
46+
log.warn("An exception while executing the internal check: {}", result);
47+
}
48+
return exitCode == 0;
4549
} catch (Exception e) {
4650
throw new IllegalStateException(e);
4751
}

0 commit comments

Comments
 (0)