fix(接口测试): 修复集合报告超时处理问题

https://github.com/metersphere/metersphere/issues/32037
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2024-07-12 12:22:30 +08:00 committed by Craftsman
parent 9ee888df79
commit 39b47825cd
1 changed files with 7 additions and 2 deletions

View File

@ -386,8 +386,13 @@ public class ApiExecutionQueueService {
executionQueueDetailMapper.deleteByPrimaryKey(item.getId()); executionQueueDetailMapper.deleteByPrimaryKey(item.getId());
continue; continue;
} }
String reportId = StringUtils.equalsIgnoreCase(queue.getReportType(), RunModeConstants.SET_REPORT.toString())
? StringUtils.join(queue.getReportId(), "_", item.getTestId())
: item.getReportId();
// 在资源池中执行 // 在资源池中执行
if (StringUtils.isNotEmpty(queue.getPoolId()) && jMeterService.getRunningQueue(queue.getPoolId(), item.getReportId())) { if (StringUtils.isNotEmpty(queue.getPoolId()) && jMeterService.getRunningQueue(queue.getPoolId(), reportId)) {
continue; continue;
} }
// 检查是否已经超时 // 检查是否已经超时
@ -405,7 +410,7 @@ public class ApiExecutionQueueService {
report.setStatus(ApiReportStatus.ERROR.name()); report.setStatus(ApiReportStatus.ERROR.name());
apiScenarioReportMapper.updateByPrimaryKeySelective(report); apiScenarioReportMapper.updateByPrimaryKeySelective(report);
LoggerUtil.info("超时处理报告:" + report.getId()); LoggerUtil.info("超时处理报告:" + report.getId());
if (queue != null && StringUtils.equalsIgnoreCase(item.getType(), RunModeConstants.SERIAL.toString())) { if (StringUtils.equalsIgnoreCase(item.getType(), RunModeConstants.SERIAL.toString())) {
LoggerUtil.info("超时处理报告:【" + report.getId() + "】进入下一个执行"); LoggerUtil.info("超时处理报告:【" + report.getId() + "】进入下一个执行");
dto.setTestPlanReportId(queue.getReportId()); dto.setTestPlanReportId(queue.getReportId());
dto.setReportId(queue.getReportId()); dto.setReportId(queue.getReportId());