diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecProc.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecProc.java index 291cf09bad..bbfd0ab209 100755 --- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecProc.java +++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecProc.java @@ -97,8 +97,11 @@ public void kill() throws IOException, InterruptedException { public int join() throws IOException, InterruptedException { try { LOGGER.log(Level.FINEST, "Waiting for websocket to close on command finish ({0})", finished); - finished.await(); - LOGGER.log(Level.FINEST, "Command is finished ({0})", finished); + if (finished.await(1, TimeUnit.MINUTES)) { + LOGGER.log(Level.FINEST, "Command is finished (the count reached zero)"); + } else { + LOGGER.log(Level.FINEST, "Command is finished (waiting time elapsed before the count reached zero)"); + } CompletableFuture exitCodeFuture = watch.exitCode();