From 96fa4cef85c89f5613612f116798c10a26c91911 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 26 Jan 2022 11:56: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=E6=8A=A5=E5=91=8A=E6=97=B6=E9=97=B4=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009945 --user=赵勇 【接口测试】场景批量执行 - 串行 - node资源池执行,执行时间和结果显示错误 https://www.tapd.cn/55049933/s/1098852 --- .../api/service/ApiScenarioReportResultService.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java index 51cf44dce1..ad16996bb8 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportResultService.java @@ -42,15 +42,6 @@ public class ApiScenarioReportResultService { //解析误报内容 ErrorReportLibraryParseDTO errorCodeDTO = ErrorReportLibraryUtil.parseAssertions(result); report.setId(UUID.randomUUID().toString()); - result.setEndTime(System.currentTimeMillis()); - if (result.getResponseResult() != null) { - long time = result.getEndTime() - result.getStartTime(); - if (time > 0) { - result.getResponseResult().setResponseTime(time); - } else { - result.setEndTime(result.getEndTime()); - } - } String resourceId = result.getResourceId(); report.setResourceId(resourceId); report.setReportId(reportId); @@ -58,7 +49,7 @@ public class ApiScenarioReportResultService { report.setPassAssertions(Long.parseLong(result.getPassAssertions() + "")); report.setCreateTime(System.currentTimeMillis()); String status = result.getError() == 0 ? ExecuteResult.Success.name() : ExecuteResult.Error.name(); - if(CollectionUtils.isNotEmpty(errorCodeDTO.getErrorCodeList())){ + if (CollectionUtils.isNotEmpty(errorCodeDTO.getErrorCodeList())) { status = ExecuteResult.errorReportResult.name(); report.setErrorCode(errorCodeDTO.getErrorCodeStr()); }