From d01b9956bb527458bc44575d37b19db0d61047dc Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 21 Feb 2022 10:00:49 +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=E4=B8=8D=E5=90=8C=E8=8A=82=E7=82=B9=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E5=8C=BA=E4=B8=8D=E4=B8=80=E8=87=B4=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=8A=A5=E5=91=8A=E6=97=B6=E9=97=B4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010397 --user=赵勇 case列表 并行执行 集合报告 选择资源池 执行时间过长 https://www.tapd.cn/55049933/s/1106305 --- .../api/service/ApiDefinitionExecResultService.java | 1 - .../api/service/ApiScenarioReportStructureService.java | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index 9fc4051249..5febf76f90 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -66,7 +66,6 @@ public class ApiDefinitionExecResultService { LoggerUtil.info("接收到API/CASE执行结果【 " + requestResults.size() + " 】"); for (RequestResult item : requestResults) { - item.setEndTime(System.currentTimeMillis()); if (item.getResponseResult() != null && item.getResponseResult().getResponseTime() <= 0) { item.getResponseResult().setResponseTime((item.getEndTime() - item.getStartTime())); } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java index 528591f179..b816de6e8f 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -195,6 +195,9 @@ public class ApiScenarioReportStructureService { } else if (step.getValue() != null) { if (step.getValue().getStartTime() == 0 || step.getValue().getEndTime() == 0) { totalTime.set(totalTime.longValue() + 0); + } else if (step.getValue().getStartTime() > step.getValue().getEndTime() && step.getValue().getResponseResult() != null) { + // 异常时间处理 + totalTime.set(totalTime.longValue() + step.getValue().getResponseResult().getResponseTime()); } else { totalTime.set((totalTime.longValue() + (step.getValue().getEndTime() - step.getValue().getStartTime()))); }