Source:
protected ComputerLauncher createLauncher(DockerAPI api, String workdir, InspectContainerResponse inspect, TaskListener listener) throws IOException, InterruptedException { if ("exited".equals(inspect.getState().getStatus())) { LOGGER.error("Failed to launch docker SSH agent :" + inspect.getState().getExitCode()); throw new IOException("Failed to launch docker SSH agent. Container exited with status " + inspect.getState().getExitCode()); } LOGGER.debug("container created {}", inspect); final InetSocketAddress address = getBindingForPort(api, inspect, port); final PortUtils.ConnectionCheck connectionCheck = PortUtils.connectionCheck( address ); PortUtils.ConnectionCheckSSH connectionCheckSSH = connectionCheck.useSSH(); final Integer maxNumRetriesOrNull = getMaxNumRetries(); if ( maxNumRetriesOrNull!=null ) { connectionCheck.withRetries( maxNumRetriesOrNull ); } final Integer retryWaitTimeOrNull = getRetryWaitTime(); if ( retryWaitTimeOrNull!=null ) { connectionCheck.withEveryRetryWaitFor( retryWaitTimeOrNull, TimeUnit.SECONDS ); } final Integer launchTimeoutSeconds = getLaunchTimeoutSeconds(); if( launchTimeoutSeconds != null) { connectionCheckSSH = connectionCheckSSH.withSSHTimeout(launchTimeoutSeconds, TimeUnit.SECONDS); } final long timestampBeforeConnectionCheck = System.nanoTime(); if (!connectionCheck.execute() || !connectionCheckSSH.execute()) { final long timestampAfterConnectionCheckEnded = System.nanoTime(); final long nanosecondsElapsed = timestampAfterConnectionCheckEnded - timestampBeforeConnectionCheck; final long secondsElapsed = TimeUnit.NANOSECONDS.toSeconds(nanosecondsElapsed); throw new IOException("SSH service hadn't started after " + secondsElapsed + " seconds."); } return sshKeyStrategy.getSSHLauncher(address, this); }

Target:
protected ComputerLauncher createLauncher(DockerAPI api, String workdir, InspectContainerResponse inspect, TaskListener listener) throws IOException, InterruptedException { if ("exited".equals(inspect.getState().getStatus())) { LOGGER.error("Failed to launch docker SSH agent :" + inspect.getState().getExitCode()); throw new IOException("Failed to launch docker SSH agent. Container exited with status " + inspect.getState().getExitCode()); } LOGGER.debug("container created {}", inspect); final InetSocketAddress address = getBindingForPort(api, inspect, port); final PortUtils.ConnectionCheck connectionCheck = PortUtils.connectionCheck( address ); final PortUtils.ConnectionCheckSSH connectionCheckSSH = connectionCheck.useSSH(); final Integer maxNumRetriesOrNull = getMaxNumRetries(); if ( maxNumRetriesOrNull!=null ) { connectionCheck.withRetries( maxNumRetriesOrNull ); } final Integer retryWaitTimeOrNull = getRetryWaitTime(); if ( retryWaitTimeOrNull!=null ) { connectionCheck.withEveryRetryWaitFor( retryWaitTimeOrNull, TimeUnit.SECONDS ); } final Integer launchTimeoutSeconds = getLaunchTimeoutSeconds(); if( launchTimeoutSeconds != null) { connectionCheckSSH.withSSHTimeout(launchTimeoutSeconds, TimeUnit.SECONDS); } final long timestampBeforeConnectionCheck = System.nanoTime(); if (!connectionCheck.execute() || !connectionCheckSSH.execute()) { final long timestampAfterConnectionCheckEnded = System.nanoTime(); final long nanosecondsElapsed = timestampAfterConnectionCheckEnded - timestampBeforeConnectionCheck; final long secondsElapsed = TimeUnit.NANOSECONDS.toSeconds(nanosecondsElapsed); final long millisecondsElapsed = TimeUnit.NANOSECONDS.toMillis(nanosecondsElapsed) - TimeUnit.SECONDS.toMillis(secondsElapsed); throw new IOException("SSH service hadn't started after " + secondsElapsed + " seconds and " + millisecondsElapsed + " milliseconds." + "Try increasing the number of retries (currently " + maxNumRetriesOrNull + ") and/or the retry wait time (currently " + retryWaitTimeOrNull + ") to allow for containers taking longer to start."); } return sshKeyStrategy.getSSHLauncher(address, this); }