From 10d42f432dc092a8645fcfa41e8cae494fd8a789 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 17 Sep 2020 14:55:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AAresponse=5Ftimeout?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E7=9B=AE=E6=A0=87=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E4=B8=8D=E5=8F=8D=E5=9B=9E=E7=BB=93=E6=9E=9C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=8D=E8=83=BD=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parse/xml/reader/jmx/JmeterDocumentParser.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index 5cdd5b3a54..fa090c5af1 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -439,6 +439,12 @@ public class JmeterDocumentParser implements DocumentParser { item.appendChild(ele.getOwnerDocument().createTextNode(context.getProperty("timeout").toString())); } } + // 增加一个response_timeout,避免目标网站不反回结果导致测试不能结束 + if (item instanceof Element && nodeNameEquals(item, STRING_PROP) + && StringUtils.equals(((Element) item).getAttribute("name"), "HTTPSampler.response_timeout")) { + removeChildren(item); + item.appendChild(ele.getOwnerDocument().createTextNode("")); + } } }