From aaf5ffd470547fc00bac5db7489bced69eb3937d Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Thu, 21 Nov 2024 18:55:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=97=A0=E6=B3=95=E7=BB=93?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/service/PlanRunTestPlanApiCaseService.java | 5 +++++ .../plan/service/PlanRunTestPlanApiScenarioService.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiCaseService.java index 29a0a939dd..7220eafe37 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiCaseService.java @@ -125,6 +125,11 @@ public class PlanRunTestPlanApiCaseService { List execTaskItems = apiBatchRunBaseService.getExecTaskItemByTaskIdAndCollectionId(testPlanExecutionQueue.getTaskId(), collection.getId(), testPlanExecutionQueue.isRerun()); + + if (CollectionUtils.isEmpty(execTaskItems)) { + return true; + } + SubListUtils.dealForSubList(execTaskItems, ApiBatchRunBaseService.BATCH_TASK_ITEM_SIZE, subExecTaskItems -> { List taskItems = subExecTaskItems .stream() diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java index 86e78cc6ed..afde50656c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java @@ -120,6 +120,11 @@ public class PlanRunTestPlanApiScenarioService { List execTaskItems = apiBatchRunBaseService.getExecTaskItemByTaskIdAndCollectionId(testPlanExecutionQueue.getTaskId(), collection.getId(), testPlanExecutionQueue.isRerun()); + + if (CollectionUtils.isEmpty(execTaskItems)) { + return true; + } + SubListUtils.dealForSubList(execTaskItems, ApiBatchRunBaseService.BATCH_TASK_ITEM_SIZE, subExecTaskItems -> { List taskItems = subExecTaskItems .stream()