fix(测试计划): 解决多个节点执行测试计划任务出现死锁问题
This commit is contained in:
parent
1726b95ae3
commit
1acdbd2e45
|
@ -159,12 +159,14 @@ public class MsScenario extends MsTestElement {
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
for (MsTestElement el : hashTree) {
|
for (MsTestElement el : hashTree) {
|
||||||
el.setParent(this);
|
if (el != null) {
|
||||||
el.setMockEnvironment(this.isMockEnvironment());
|
el.setParent(this);
|
||||||
if (this.isEnvironmentEnable()) {
|
el.setMockEnvironment(this.isMockEnvironment());
|
||||||
el.toHashTree(scenarioTree, el.getHashTree(), newConfig);
|
if (this.isEnvironmentEnable()) {
|
||||||
} else {
|
el.toHashTree(scenarioTree, el.getHashTree(), newConfig);
|
||||||
el.toHashTree(scenarioTree, el.getHashTree(), config);
|
} else {
|
||||||
|
el.toHashTree(scenarioTree, el.getHashTree(), config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package io.metersphere.api.jmeter;
|
||||||
import io.metersphere.api.exec.queue.PoolExecBlockingQueueUtil;
|
import io.metersphere.api.exec.queue.PoolExecBlockingQueueUtil;
|
||||||
import io.metersphere.api.service.ApiExecutionQueueService;
|
import io.metersphere.api.service.ApiExecutionQueueService;
|
||||||
import io.metersphere.api.service.TestResultService;
|
import io.metersphere.api.service.TestResultService;
|
||||||
import io.metersphere.commons.constants.ApiRunMode;
|
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||||
import io.metersphere.dto.ResultDTO;
|
import io.metersphere.dto.ResultDTO;
|
||||||
import io.metersphere.jmeter.MsExecListener;
|
import io.metersphere.jmeter.MsExecListener;
|
||||||
|
@ -22,13 +21,6 @@ public class APISingleResultListener extends MsExecListener {
|
||||||
LoggerUtil.info("处理单条执行结果报告【" + dto.getReportId() + " 】,资源【 " + dto.getTestId() + " 】");
|
LoggerUtil.info("处理单条执行结果报告【" + dto.getReportId() + " 】,资源【 " + dto.getTestId() + " 】");
|
||||||
dto.setConsole(FixedCapacityUtils.getJmeterLogger(dto.getReportId()));
|
dto.setConsole(FixedCapacityUtils.getJmeterLogger(dto.getReportId()));
|
||||||
CommonBeanFactory.getBean(TestResultService.class).saveResults(dto);
|
CommonBeanFactory.getBean(TestResultService.class).saveResults(dto);
|
||||||
|
|
||||||
// 更新报告最后接收到请求的时间
|
|
||||||
if (StringUtils.equalsAny(dto.getRunMode(), ApiRunMode.SCENARIO.name(),
|
|
||||||
ApiRunMode.SCENARIO_PLAN.name(), ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(),
|
|
||||||
ApiRunMode.SCHEDULE_SCENARIO.name(), ApiRunMode.JENKINS_SCENARIO_PLAN.name())) {
|
|
||||||
CommonBeanFactory.getBean(TestResultService.class).editReportTime(dto);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -610,8 +610,9 @@ public class TestPlanReportService {
|
||||||
try {
|
try {
|
||||||
//更新TestPlan状态为完成
|
//更新TestPlan状态为完成
|
||||||
TestPlanWithBLOBs testPlan = testPlanMapper.selectByPrimaryKey(report.getTestPlanId());
|
TestPlanWithBLOBs testPlan = testPlanMapper.selectByPrimaryKey(report.getTestPlanId());
|
||||||
if (testPlan != null) {
|
if (testPlan != null && !StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Completed.name())) {
|
||||||
testPlanService.checkStatus(testPlan);
|
testPlan.setStatus(TestPlanStatus.Completed.name());
|
||||||
|
testPlanService.editTestPlan(testPlan);
|
||||||
}
|
}
|
||||||
if (testPlan != null && StringUtils.equalsAny(report.getTriggerMode(),
|
if (testPlan != null && StringUtils.equalsAny(report.getTriggerMode(),
|
||||||
ReportTriggerMode.MANUAL.name(),
|
ReportTriggerMode.MANUAL.name(),
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
alter table api_execution_queue_detail add index queue_id_test_id_index(queue_id,test_id);
|
Loading…
Reference in New Issue