Search code examples
jmeterjmeter-pluginsjmeter-5.0jmeter-maven-plugin

JMeter (An established connection was aborted by the software in your host machine)


I am testing JMeter on my site, I use debug and catch exception which close my socket, I don't understand the reason for that error: Response code:Websocket I/O error Response message:WebSocket I/O error: Программа на вашем хо�т-компьютере разорвала у�тановленное подключение (it means "An established connection was aborted by the software in your host machine").

Screenshot
enter image description here


Solution

  • First of all it looks like you're getting multiple frames as the response to a single call, as per documentation:

    Fragmentation

    WebSocket messages may be fragmented into several frames. In such cases the first frame is an ordinary text or binary frame, but it will have the final bit cleared. The succeeding frames will be continuation frames (whether they are text or binary is inferred by the first frame) and the last continuation frame will have the final bit set. The plugin supports continuation frames, but as the plugin is frame-oriented, you'll have to read them yourself. In cases where the number of fragments is known beforehand, this is as easy as adding an extra WebSocketReadSampler for each continuation frame you expect. If the number of continuation frames is not known, you need to create a loop to read all the continuation frames. For this purpose, the plugin provides a new JMeter variable called websocket.last_frame_final that indicates whether the last frame read was final. This enables you to write a simple loop with a standard JMeter While Controller; use the expression ${__javaScript(! ${websocket.last_frame_final},)} as condition. With a JMeter If Controller, the condition can be simplified to ! ${websocket.last_frame_final} because that controller automatically interprets the condition as JavaScript. See the sample Read continuation frames.jmx test plan for examples of using the While or the If controller to read continuation frames.

    If you are unsure whether continuation frames are sent by your server or how much, switch on debug logging: samplers reading a frame will log whether the received frame is a "normal" single frame, a non-final frame (i.e. 1st fragment), a continuation frame or a final continuation frame (last fragment).


    If this is not the case, another possible reason I can think of is that something is terminating the websocket connection on your machine, I don't know what exactly, maybe a firewall or an antivirus or your corporate proxy server

    Try opening inbound and outbound traffic for the java process, add it to your antivirus whitelist and ask around, maybe your network administrator can shed some light on it.

    If you want to get some more troubleshooting information you can add the next line to JMeter's system.properties file:

    javax.net.debug=all
    

    and inspect JMeter's stdout to see if there is a clue there.

    More information: Debugging SSL/TLS Connections