fix(测试计划): 统一性能测试执行错误消息
This commit is contained in:
parent
542b2796e1
commit
3072ddf3a3
|
@ -135,23 +135,21 @@ public class TestPlanLoadCaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runBatch(RunBatchTestPlanRequest request) {
|
public void runBatch(RunBatchTestPlanRequest request) {
|
||||||
if (request.getConfig() != null && request.getConfig().getMode().equals(RunModeConstants.SERIAL.toString())) {
|
try {
|
||||||
try {
|
if (request.getConfig() != null && request.getConfig().getMode().equals(RunModeConstants.SERIAL.toString())) {
|
||||||
serialRun(request);
|
serialRun(request);
|
||||||
} catch (Exception e) {
|
} else {
|
||||||
String message = e.getMessage();
|
ExecutorService executorService = Executors.newFixedThreadPool(request.getRequests().size());
|
||||||
if (StringUtils.isNotEmpty(message)) {
|
request.getRequests().forEach(item -> {
|
||||||
message = message.replace("io.metersphere.commons.exception.MSException:", "");
|
executorService.submit(new ParallelExecTask(performanceTestService, testPlanLoadCaseMapper, item));
|
||||||
MSException.throwException(message);
|
});
|
||||||
}else{
|
}
|
||||||
MSException.throwException("请求参数错误,请刷新后执行");
|
} catch (Exception e) {
|
||||||
}
|
if (StringUtils.isNotEmpty(e.getMessage())) {
|
||||||
|
MSException.throwException("测试正在运行, 请等待!");
|
||||||
|
} else {
|
||||||
|
MSException.throwException("请求参数错误,请刷新后执行!");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ExecutorService executorService = Executors.newFixedThreadPool(request.getRequests().size());
|
|
||||||
request.getRequests().forEach(item -> {
|
|
||||||
executorService.submit(new ParallelExecTask(performanceTestService, testPlanLoadCaseMapper, item));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue