From b9844c40c145ecfa6c240556cc8df31d3fbd408f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 23 May 2023 11:53:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A1=E5=88=92=E5=81=B6=E5=8F=91=E6=97=A0?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1026438 --user=赵勇 【测试计划】【偶发】测试计划详情-接口列表,接口用例执行结果没更新 https://www.tapd.cn/55049933/s/1374302 Signed-off-by: fit2-zhao --- .../main/java/io/metersphere/service/RemakeReportService.java | 2 ++ .../main/java/io/metersphere/service/TestResultService.java | 3 ++- .../jmeter/src/main/java/io/metersphere/dto/ResultDTO.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/RemakeReportService.java b/api-test/backend/src/main/java/io/metersphere/service/RemakeReportService.java index 1809556543..3b445883d1 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/RemakeReportService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/RemakeReportService.java @@ -27,6 +27,7 @@ public class RemakeReportService { BeanUtils.copyBean(dto, request); dto.setQueueId(request.getQueueId()); dto.setTestId(request.getTestId()); + dto.setErrorEnded(true); LoggerUtil.info("进入异常结果处理:" + dto.getRunMode() + " 整体处理完成", dto.getReportId()); // 全局并发队列 PoolExecBlockingQueueUtil.offer(dto.getReportId()); @@ -50,6 +51,7 @@ public class RemakeReportService { BeanUtils.copyBean(dto, request); dto.setQueueId(request.getQueueId()); dto.setTestId(request.getTestId()); + dto.setErrorEnded(true); String consoleMsg = FixedCapacityUtil.getJmeterLogger(dto.getReportId(), true); dto.setConsole(consoleMsg + StringUtils.LF + errorMsg); testResultService.testEnded(dto); diff --git a/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java b/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java index 4063957e59..0a868797fb 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java @@ -30,6 +30,7 @@ import io.metersphere.vo.ResultVO; import jakarta.annotation.Resource; import org.apache.commons.beanutils.BeanMap; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -267,7 +268,7 @@ public class TestResultService { sendTask(reportTask, dto.getTestId()); } } - } else if (apiRunModes.contains(dto.getRunMode())) { + } else if (apiRunModes.contains(dto.getRunMode()) && BooleanUtils.isTrue(dto.getErrorEnded())) { // 只处理RUNNING中的执行报告 updateRunningResult(dto); } diff --git a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/ResultDTO.java b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/ResultDTO.java index 5398d0f979..14dbd0fdda 100644 --- a/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/ResultDTO.java +++ b/framework/sdk-parent/jmeter/src/main/java/io/metersphere/dto/ResultDTO.java @@ -21,6 +21,9 @@ public class ResultDTO { private Boolean hasEnded; // 失败重试 private boolean retryEnable; + // 异常终止 + private Boolean errorEnded; + /** * 增加一个全局扩展的通传参数 */