unexpected frame type (ping).Received: Ping frame with application data
No description provided.
Comments (6)
-
repo owner -
repo owner -
repo owner - changed status to invalid
-
I’m also receiving this error.
Using the WebSocket Single Write Sampler and the WebSocket Single Read Sampler.
the WebSocket Single Read Sampler does not receive the answer on the written request but receives:
”
Thread Name:Customer User 1-1
Sample Start:2023-11-15 18:24:25 EAT
Load time:0
Connect Time:0
Latency:0
Size in bytes:0
Sent bytes:0
Headers size in bytes:0
Body size in bytes:0
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):
Response code:Sampler error: unexpected frame type (ping).
Response message:Received: Ping frame with application data 'Heartbeat check.'
SampleResult fields:
ContentType:
DataEncoding: null
”the same happens also in the WebSocket request-response Sampler
The expected behaviour should be to ignore this ping frame and wait for the correct answer frame.
-
repo owner Quote from the documentation (https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/)
To handle situations in which the server sends unsolicited messages and the occurrence of such messages is hard to predict or otherwise hard to take into account in the test plan, filters can be used to discard such messages before they are seen by a sampler. There are three different kinds of filters:
- Ping/Pong frame filter: discards all ping and pong frames and has an option to automatically respond to pings (with a pong of course)
-
On WebSocket request-response Sampler the exception looks like this:
”
Thread Name:Customer User 1-1
Sample Start:2023-11-16 08:18:52 EAT
Load time:1
Connect Time:0
Latency:0
Size in bytes:18
Sent bytes:787
Headers size in bytes:2
Body size in bytes:16
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):
Response code:Sampler error
Response message:Sampler error: java.lang.ClassCastException: class eu.luminis.websocket.PingFrame cannot be cast to class eu.luminis.websocket.DataFrame (eu.luminis.websocket.PingFrame and eu.luminis.websocket.DataFrame are in unnamed module of loader org.apache.jmeter.DynamicClassLoader @4517d9a3)
SampleResult fields:
ContentType:
DataEncoding: null
”As a consequence the exception in one Sampler leads to a message shift in follow-up request:
”
Assertion error:false
Assertion failure:true
Assertion failure message:Value in json path '.RequestID' expected to be '120', but found '[119]'
”
which then has unexpected and mostly fatal effects for the test run.If it is a general behaviour of the target system it needs to be added to the global configuration with “ Add > Config Element > WebSocket Ping/Pong Frame Filter “ Or to each Sampler individually or it can be copied from one Sampler to the next.
Additionally I observed when Ping messages are not responded the target system might close the connection unexpectedly like seen in:
”
Thread Name:Customer User 1-1
Sample Start:2023-11-16 08:52:24 EAT
Load time:0
Connect Time:0
Latency:0
Size in bytes:2
Sent bytes:617
Headers size in bytes:2
Body size in bytes:0
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):
Response code:Sampler error
Response message:Sampler error: java.lang.ClassCastException: class eu.luminis.websocket.CloseFrame cannot be cast to class eu.luminis.websocket.DataFrame (eu.luminis.websocket.CloseFrame and eu.luminis.websocket.DataFrame are in unnamed module of loader org.apache.jmeter.DynamicClassLoader @4517d9a3)
SampleResult fields:
ContentType:
DataEncoding: null
“
In this case the filter option “ Automatically respond to a ping with a pong “ needs to me marked to prevent this.
- Log in to comment
Normally i don’t respond to issues that don’t have a proper description (if you can’t take the effort to create a decent description, why should i take time to respond???)
In this case, I’ll make an exception. There are numerous issues in this project that also address “unexpected frame type”, maybe read them first and then if you still don’t get it, you could ask a question.