diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 90ab323a80..17d0f1d75d 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -122,18 +122,16 @@ public class MsScenario extends MsTestElement { // 环境变量 Arguments arguments = ElementUtil.getConfigArguments(this.isEnvironmentEnable() ? newConfig : config, this.getName(), this.getProjectId(), this.getVariables()); - if (arguments != null && ((this.variableEnable == null || this.variableEnable) - || (this.mixEnable == null || this.mixEnable))) { + if (arguments != null && !arguments.getArguments().isEmpty()) { Arguments valueSupposeMock = ParameterConfig.valueSupposeMock(arguments); // 这里加入自定义变量解决ForEach循环控制器取值问题,循环控制器无法从vars中取值 - if ((this.variableEnable == null || this.variableEnable) - || (this.mixEnable == null || this.mixEnable)) { + if (BooleanUtils.isTrue(this.variableEnable) || BooleanUtils.isTrue(this.mixEnable)) { scenarioTree.add(ElementUtil.argumentsToUserParameters(valueSupposeMock)); - } else { + } else if (config != null && StringUtils.equals(this.getId(), config.getScenarioId())) { scenarioTree.add(valueSupposeMock); } } - if (this.variableEnable == null || this.variableEnable) { + if (BooleanUtils.isTrue(this.variableEnable) || BooleanUtils.isTrue(this.mixEnable)) { ElementUtil.addCsvDataSet(scenarioTree, variables, this.isEnvironmentEnable() ? newConfig : config, "shareMode.group"); ElementUtil.addCounter(scenarioTree, variables); ElementUtil.addRandom(scenarioTree, variables); diff --git a/api-test/backend/src/main/java/io/metersphere/api/jmeter/MsKafkaListener.java b/api-test/backend/src/main/java/io/metersphere/api/jmeter/MsKafkaListener.java index 1ee99676ee..e4c071c904 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/jmeter/MsKafkaListener.java +++ b/api-test/backend/src/main/java/io/metersphere/api/jmeter/MsKafkaListener.java @@ -30,9 +30,9 @@ public class MsKafkaListener { @Resource private TestResultService testResultService; // 线程池维护线程的最少数量 - private final static int CORE_POOL_SIZE = 20; + private final static int CORE_POOL_SIZE = 5; // 线程池维护线程的最大数量 - private final static int MAX_POOL_SIZE = 20; + private final static int MAX_POOL_SIZE = 5; // 线程池维护线程所允许的空闲时间 private final static int KEEP_ALIVE_TIME = 1; // 线程池所使用的缓冲队列大小 diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FileUtils.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FileUtils.java index 0f8e5a84bf..60007eaa60 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FileUtils.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FileUtils.java @@ -421,7 +421,7 @@ public class FileUtils { public static byte[] fileToByte(File tradeFile) { byte[] buffer = null; try (FileInputStream fis = new FileInputStream(tradeFile); - ByteArrayOutputStream bos = new ByteArrayOutputStream();) { + ByteArrayOutputStream bos = new ByteArrayOutputStream()) { byte[] b = new byte[1024]; int n; while ((n = fis.read(b)) != -1) { @@ -429,7 +429,7 @@ public class FileUtils { } buffer = bos.toByteArray(); } catch (Exception e) { - LoggerUtil.error(e); + LogUtil.error(e); } return buffer; }