fix(接口测试): 修复用例执行未选环境情况报告状态错误

--bug=1009633 --user=赵勇 【接口测试】接口用例列表,批量-串行-执行接口用例,任务中心有一部分用例timeout了 https://www.tapd.cn/55049933/s/1092216
This commit is contained in:
fit2-zhao 2022-01-14 18:03:44 +08:00 committed by fit2-zhao
parent 532cf942d5
commit ed26b6a2e8
2 changed files with 5 additions and 1 deletions

View File

@ -137,7 +137,7 @@ public class ApiScenarioSerialService {
} else {
ApiDefinitionExecResult apiDefinitionExecResult = apiDefinitionExecResultMapper.selectByPrimaryKey(queue.getReportId());
if (apiDefinitionExecResult != null) {
apiDefinitionExecResult.setStatus("timeout");
apiDefinitionExecResult.setStatus("Error");
apiDefinitionExecResultMapper.updateByPrimaryKey(apiDefinitionExecResult);
}
}

View File

@ -185,9 +185,11 @@ public class ApiExecutionQueueService {
}
}
if (CollectionUtils.isEmpty(queues)) {
LoggerUtil.info("execution complete,clear queue" + id + "");
queueMapper.deleteByPrimaryKey(id);
}
} else {
LoggerUtil.info("execution complete,clear queue" + id + "");
queueMapper.deleteByPrimaryKey(id);
}
}
@ -299,10 +301,12 @@ public class ApiExecutionQueueService {
queues.forEach(item -> {
// 更新测试计划报告
if (StringUtils.isNotEmpty(item.getReportId())) {
LoggerUtil.info("处理不在执行队列中的测试计划报告:【" + item.getReportId() + "");
CommonBeanFactory.getBean(TestPlanReportService.class).finishedTestPlanReport(item.getReportId(), TestPlanReportStatus.COMPLETED.name());
}
});
}
List<String> testPlanReports = extApiExecutionQueueMapper.findTestPlanRunningReport();
if (CollectionUtils.isNotEmpty(testPlanReports)) {
testPlanReports.forEach(reportId -> {