}
void doFinish() {
for (PerfTest each : perfTestService.getAllAbnormalTesting()) {
LOG.info("Terminate {}", each.getId());
SingleConsole consoleUsingPort = consoleManager.getConsoleUsingPort(each.getPort());
doTerminate(each, consoleUsingPort);
cleanUp(each);
notifyFinish(each, StopReason.TOO_MANY_ERRORS);
}
for (PerfTest each : perfTestService.getAllStopRequested()) {
LOG.info("Stop test {}", each.getId());
SingleConsole consoleUsingPort = consoleManager.getConsoleUsingPort(each.getPort());
doCancel(each, consoleUsingPort);
cleanUp(each);
notifyFinish(each, StopReason.CANCEL_BY_USER);
}
for (PerfTest each : perfTestService.getAllTesting()) {
SingleConsole consoleUsingPort = consoleManager.getConsoleUsingPort(each.getPort());
if (isTestFinishCandidate(each, consoleUsingPort)) {
doNormalFinish(each, consoleUsingPort);
cleanUp(each);
notifyFinish(each, StopReason.NORMAL);
}