protected void doFinish(boolean initial) {
		if (!initial && consoleManager.getConsoleInUse().isEmpty()) {
			return;
		}

		if (initial) {
			String message = "Test is canceled by system";
			for (PerfTest each : perfTestService.getAllProgressing()) {
				SingleConsole consoleUsingPort = consoleManager.getConsoleUsingPort(each.getPort());
				doCancel(each, consoleUsingPort, message);
				LOG.info(format(each, message, each.getId()));
				cleanUp(each);
				notifyFinish(each, StopReason.CANCEL_BY_SYSTEM);
			}
		}

		doFinish();
	}
Finish the tests.(Scheduled by SpringTask)
<p/>
There are three types of test finish.
<p/>
<ul>
<li>Abnormal test finish : when TPS is too low or too many errors occur</li>
<li>User requested test finish : when user requested to finish the test</li>
<li>Normal test finish : when the test reaches the planned duration and run
count.</li>
</ul>
ngrinder-controller/src/main/java/org/ngrinder/perftest/service/PerfTestRunnable.java