Showing 'Response message: Received: Close frame with status code 1000 and close reason 'null'' in sample result for 'Websocket request response sampler'

Issue #144 new
Anup Kumar created an issue

I have to create a Load test script for Websocket connection and i tried below samplers to achieve the task but it did’t worked :

  • websocket single read sampler
  • websocket request-response sampler

Every time when i run the scripts, it shows below sampler error

Response message: Received: Close frame with status code 1000 and close reason ‘null’

However, Websocket Open connection worked and even ‘Websocket Single Write sampler’ also worked.

Below are the sequence of samplers which i used in my script:

  1. Websocket open connection
  2. Websocket single write sampler
  3. Websocket single read sampler

1 and 2 sampler got passed but 3rd one showing error.

Comments (6)

  1. Peter Doornbosch repo owner

    So what happens is that you send a message to the server and the server responds by closing the (websocket) connection. The plugin can’t help that your server is closing the connection. Compare it to you are making a phone call and the other side hangs up. You won’t blame the phone, would you?

  2. Anup Kumar reporter

    Thanks Peter for your quick reply. I’ll coordinate with my server team try to identify the root cause. Will update you once I’ll encounter any other problem.

  3. Anup Kumar reporter

    Hey Peter, I again have a doubt.

    Why server will respond with this message ‘Sampler error: unexpected frame type (close)’ only for ‘WebSocket Read Sampler’. It should show same error during ‘WebSocket Ping/Pong sampler’ as well.

    I have added a sampler ' ‘WebSocket Ping/Pong sampler' with ping/pong (Send Ping and expect Pong) and it working (Showing 200 ok).

    It means WebSocket Open sampler, WebSocket Ping/Pong sampler', WebSocket Write Sampler is working but ‘WebSocket Read sampler’ is not working.

    I have tried to overcome this in coordination with server team as well and tried to establish Websocket connection with removing all layers (Security) but again no luck.

    Can You Please suggest what could be the possible reason.

  4. Peter Doornbosch repo owner

    Your reasoning is not valid. It’s quite normal that ping/pong is implemented in the server at a different level; your server application is probably not even seeing the ping/pong.

    The best advice i can give is to create a WireShark capture of the communication between a normal client and the server and between the test plan and the server and than compare the two. You’ll then see that your test plan is sending different data than the test plan which causes the server to react differently.

    Regards

    Peter

  5. Log in to comment