From e40af330cdeaf236e9bbad1b16d6f1c431837a05 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 20 Jan 2022 16:23:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E7=AE=97=E5=B9=B6=E5=8F=91=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009785 --user=刘瑞斌 【性能测试】github#9571,线程组的并发用户数总和应该为开启的线程组的和,而不是所有的线程组 https://www.tapd.cn/55049933/s/1095072 Closes #9571 --- .../performance/engine/AbstractEngine.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java index 58e28bb79d..1182b31317 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java @@ -143,15 +143,25 @@ public abstract class AbstractEngine implements Engine { if (next instanceof List) { List o = (List) next; for (Object o1 : o) { - if (StringUtils.equals(JSONObject.parseObject(o1.toString()).getString("deleted"), "true")) { - iterator.remove(); - continue outer; + JSONObject jsonObject = JSONObject.parseObject(o1.toString()); + String key = jsonObject.getString("key"); + if (StringUtils.equals(key, "deleted")) { + String value = jsonObject.getString("value"); + if (StringUtils.equals(value, "true")) { + iterator.remove(); + continue outer; + } } } for (Object o1 : o) { - if (StringUtils.equals(JSONObject.parseObject(o1.toString()).getString("enabled"), "false")) { - iterator.remove(); - continue outer; + JSONObject jsonObject = JSONObject.parseObject(o1.toString()); + String key = jsonObject.getString("key"); + if (StringUtils.equals(key, "enabled")) { + String value = jsonObject.getString("value"); + if (StringUtils.equals(value, "false")) { + iterator.remove(); + continue outer; + } } } }