JMeter TCP Sampler incorrectly reports 500

匿名 (未验证) 提交于 2019-12-03 07:50:05

问题:

I'm using JMeter to load test our SMTP server using the TCP Sampler (BinaryTCPClientImpl class) to fire HELOs, wait for 30 seconds and then QUITing.

The SMTP server accepts the HELO and responds accordingly, with JMeter logging the correct response, however it does not appear to find then of the response and instead hits the response timeout and shows a 500 fail for the request.

In the JMeter logs it says:

ERROR - jmeter.protocol.tcp.sampler.TCPSampler:      org.apache.jmeter.protocol.tcp.sampler.ReadException: at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.read(BinaryTCPClientImpl.java:137) at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:350) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271) at java.lang.Thread.run(Unknown Source) Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.read(BinaryTCPClientImpl.java:123) 

This despite the fact it managed to log the expected response!

I'm guessing JMeter has somehow failed to spot the end of the response?

Any thoughts in how to solve or debug this would be much appreciated.

回答1:

If you don't define the EOM byte, it reads until the end of the stream. Since the stream isn't going to end, it times out. You have to set the EOM byte correctly for the protocol you're using.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!