fix: Jenkins插件执行有失败用例的测试计划时Jenkins插件会一直死循环 #4809 (#4810) (#4826)

Co-authored-by: Xiaowu Chen <five3@163.com>
This commit is contained in:
metersphere-bot 2021-07-19 16:56:38 +08:00 committed by GitHub
parent 2de6866475
commit a981cc1a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ public class MsThreadGroup extends MsTestElement {
threadGroup.setDuration(0); threadGroup.setDuration(0);
threadGroup.setProperty(ThreadGroup.ON_SAMPLE_ERROR, ThreadGroup.ON_SAMPLE_ERROR_CONTINUE); threadGroup.setProperty(ThreadGroup.ON_SAMPLE_ERROR, ThreadGroup.ON_SAMPLE_ERROR_CONTINUE);
threadGroup.setScheduler(false); threadGroup.setScheduler(false);
if (onSampleError != null && !onSampleError) { if (onSampleError != null && onSampleError) { // onSampleError 为true 表示失败停止
threadGroup.setProperty("ThreadGroup.on_sample_error", "stoptest"); threadGroup.setProperty("ThreadGroup.on_sample_error", "stoptest");
} }
threadGroup.setSamplerController(loopController); threadGroup.setSamplerController(loopController);

View File

@ -158,7 +158,7 @@ public class TestPlanController {
ApiRunConfigDTO api = new ApiRunConfigDTO(); ApiRunConfigDTO api = new ApiRunConfigDTO();
api.setMode(testplanRunRequest.getMode()); api.setMode(testplanRunRequest.getMode());
api.setResourcePoolId(testplanRunRequest.getResourcePoolId()); api.setResourcePoolId(testplanRunRequest.getResourcePoolId());
api.setOnSampleError(true); api.setOnSampleError(false); // OnSampleError 为false表示失败不停止若设置为true会导致bug #4809
api.setReportType("iddReport"); api.setReportType("iddReport");
String apiRunConfig = JSONObject.toJSONString(api); String apiRunConfig = JSONObject.toJSONString(api);
return testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig); return testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig);