public String describeElapsedTimeout()

in surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java [94:136]


    public String describeElapsedTimeout() throws TestSetFailedException {
        final StringBuilder msg = new StringBuilder();
        final boolean isShutdownTimeout = shutdownStatus.isTimeoutElapsed();
        final boolean isForcedShutdownTimeout = forcedShutdownStatus.isTimeoutElapsed();
        if (isShutdownTimeout || isForcedShutdownTimeout) {
            msg.append("The test run has finished abruptly after timeout of ");
            msg.append(nanosToSeconds(minTimeout(timeoutNanos, timeoutForcedNanos)));
            msg.append(" seconds.\n");

            try {
                final TreeSet<String> executedTests = new TreeSet<>();
                final TreeSet<String> incompleteTests = new TreeSet<>();

                if (isShutdownTimeout) {
                    printShutdownHook(executedTests, incompleteTests, shutdownStatus.getDescriptionsBeforeShutdown());
                }

                if (isForcedShutdownTimeout) {
                    printShutdownHook(
                            executedTests, incompleteTests, forcedShutdownStatus.getDescriptionsBeforeShutdown());
                }

                if (!executedTests.isEmpty()) {
                    msg.append("These tests were executed in prior to the shutdown operation:\n");
                    for (String executedTest : executedTests) {
                        msg.append(executedTest).append('\n');
                    }
                }

                if (!incompleteTests.isEmpty()) {
                    msg.append("These tests are incomplete:\n");
                    for (String incompleteTest : incompleteTests) {
                        msg.append(incompleteTest).append('\n');
                    }
                }
            } catch (InterruptedException e) {
                throw new TestSetFailedException("Timed termination was interrupted.", e);
            } catch (ExecutionException e) {
                throw new TestSetFailedException(e.getLocalizedMessage(), e.getCause());
            }
        }
        return msg.toString();
    }