From a1be77e885e59ad9119e58da99ae1805c3892d80 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Mon, 21 Oct 2024 16:39:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20k8?= =?UTF-8?q?s=E8=AE=BE=E7=BD=AE=E5=8D=95=E4=BB=BB=E5=8A=A1=E5=B9=B6?= =?UTF-8?q?=E5=8F=91=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiExecuteService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java index 858a059743..4fd5ae40ff 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiExecuteService.java @@ -233,6 +233,7 @@ public class ApiExecuteService { if (isK8SResourcePool) { TestResourceDTO testResourceDTO = new TestResourceDTO(); BeanUtils.copyBean(testResourceDTO, testResourcePoolDTO.getTestResourceReturnDTO()); + taskInfo.setPerTaskSize(testResourceDTO.getPodThreads()); taskInfo.setPoolSize(testResourceDTO.getConcurrentNumber()); LogUtils.info("开始发送请求【 {}_{} 】到 K8S 资源池执行", taskItem.getReportId(), taskItem.getResourceId()); if (isDebugMode) { @@ -315,6 +316,7 @@ public class ApiExecuteService { TestResourceDTO testResourceDTO = new TestResourceDTO(); BeanUtils.copyBean(testResourceDTO, testResourcePool.getTestResourceReturnDTO()); taskInfo.setPoolSize(testResourceDTO.getConcurrentNumber()); + taskInfo.setPerTaskSize(testResourceDTO.getPodThreads()); try { EngineFactory.batchRunApi(taskRequest, testResourceDTO); } catch (Exception e) { @@ -337,6 +339,7 @@ public class ApiExecuteService { } else { distributeTask = distributeTasks.get(nodeIndex); } + taskInfo.setPerTaskSize(Optional.ofNullable(nodesList.get(nodeIndex).getSingleTaskConcurrentNumber()).orElse(3)); distributeTask.getTaskInfo().setPoolSize(nodesList.get(nodeIndex).getConcurrentNumber()); distributeTask.getTaskItems().add(taskRequest.getTaskItems().get(i)); }