fix(测试跟踪): 修复批量执行接口用例时部分用例异常的问题

--bug=1018669 --user=宋天阳 【测试跟踪】测试计划-接口用例列表中批量执行用例执行结果部分用例异常
https://www.tapd.cn/55049933/s/1274489
This commit is contained in:
song-tianyang 2022-10-24 17:17:36 +08:00 committed by 建国
parent 20f5341f2d
commit 443a13658e
1 changed files with 7 additions and 10 deletions

View File

@ -15,10 +15,6 @@ import io.metersphere.api.exec.queue.DBTestQueue;
import io.metersphere.api.jmeter.JMeterService;
import io.metersphere.api.jmeter.NewDriverManager;
import io.metersphere.api.jmeter.utils.SmoothWeighted;
import io.metersphere.commons.utils.*;
import io.metersphere.constants.RunModeConstants;
import io.metersphere.service.ApiExecutionQueueService;
import io.metersphere.service.RemakeReportService;
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
import io.metersphere.base.domain.ApiExecutionQueueDetail;
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
@ -30,10 +26,14 @@ import io.metersphere.commons.constants.ApiRunMode;
import io.metersphere.commons.constants.ElementConstants;
import io.metersphere.commons.constants.PropertyConstant;
import io.metersphere.commons.enums.ApiReportStatus;
import io.metersphere.commons.utils.*;
import io.metersphere.constants.RunModeConstants;
import io.metersphere.dto.JmeterRunRequestDTO;
import io.metersphere.dto.ResultDTO;
import io.metersphere.environment.service.BaseEnvironmentService;
import io.metersphere.plugin.core.MsTestElement;
import io.metersphere.service.ApiExecutionQueueService;
import io.metersphere.service.RemakeReportService;
import io.metersphere.utils.LoggerUtil;
import io.metersphere.xpack.api.service.ApiRetryOnFailureService;
import org.apache.commons.lang3.StringUtils;
@ -44,11 +44,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.*;
@Service
@Transactional(rollbackFor = Exception.class)
@ -203,7 +199,8 @@ public class ApiCaseSerialService {
list.addAll(elements);
}
if (element.optString(PropertyConstant.TYPE).equals(ElementConstants.HTTP_SAMPLER)) {
MsHTTPSamplerProxy httpSamplerProxy = JSON.parseObject(api, MsHTTPSamplerProxy.class);
MsHTTPSamplerProxy httpSamplerProxy = mapper.readValue(element.toString(), new TypeReference<MsHTTPSamplerProxy>() {
});
httpSamplerProxy.setHashTree(list);
httpSamplerProxy.setName(planId);
if (StringUtils.isNotEmpty(envId)) {