XPath and XPath2 extractors insert a new line in the failure message which breaks CSV log file formatting for the listener.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- java
- 领域
- testing-qa
调研方向
从 issue 中链接的失败消息调用处开始检查 src/components/src/main/java/org/apache/jmeter/extractor/XPathExtractor.java 和 XPath2Extractor.java。检查追加的文本如何到达 listener 的 CSV 输出;如果项目提供了相关的测试位置,则添加覆盖。完成的标准是 extractor 失败时保留解释性文本,且不插入会干扰 CSV 处理的换行符。
由索引模型根据 Issue 内容生成。
描述
Using an XPath or XPath2 extractor on a http sampler.
If the http sampler fails, or the response is empty, or not in the expected format, the extractor fails and appends text to its failure message
This appended text inserts a new line character before the appended text.
The new line character is logged by listener when logging the failure message, and breaks the file format when the listener is logging as CSV.
These files
ass.setFailureMessage(thrown.getLocalizedMessage()+"\nSee log file for further details.");
Line 199 XPath Extractor
ass.setFailureMessage(thrown.getLocalizedMessage()+"\nSee log file for further details.");
[Line 165 XPath2] (https://github.com/apache/jmeter/blob/c7279348335b820c35ee570462cb2e0b4eb1c370/src/components/src/main/java/org/apache/jmeter/extractor/XPath2Extractor.java)
Example CSV output :
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Filename,Latency,Encoding,SampleCount,ErrorCount,Hostname,IdleTime,Connect
2023/02/03 10:16:46.263,213,Test,502,FailureMessage,Thread Group 1-1,text,false,"Premature end of file.
See log file for further details.",0,0,1,1,null,,0,ISO-8859-1,1,1,MachineName,0,0
This should look like
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Filename,Latency,Encoding,SampleCount,ErrorCount,Hostname,IdleTime,Connect
2023/02/03 10:16:46.263,213,Test,502,FailureMessage,Thread Group 1-1,text,false,"Premature end of file. See log file for further details.",0,0,1,1,null,,0,ISO-8859-1,1,1,SBGMLXNK094VJCR,0,0
The problem this causes is the file then cannot be processed as a valid CSV without manually correcting/removing the new lines, eg a post test JMeter report cannot be generated as it cannot read the file as a CSV format.
- 主要语言
- Java
- 星标
- 9.6k
- 派生
- 2.3k
- 平均合并
- 18 小时 33 分钟
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/jmeter 的其他 Issue
-
[Bug] Typo in assertion property name: "Asserion.test_strings" missing 't'可能已有人在做 @waterWang 于 48 天前认领。 未关闭defect to-triage
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement to-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
RandomDate ignores inclusive end date and throws when start == end可能已有人在做 @weillercarvalho 于 325 天前认领。 未关闭defect to-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
documentation to-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
P2
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
liquid-java/liquidjava#373 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
NationalSecurityAgency/ghidra#9748 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
spring-mcp-tools
难度 2/5 1-3 小时 新手友好度 85/100
explyt/spring-plugin#591 ·
维护者通常 1 天内回复