JMeter - How to handle Longpolling transport method
Asked Answered
D

2

1

One of the Jmeter requests which I captured contains the 'LongPolling' transport method. So it takes high load time/latency.

I don't want to have this much of high latency in the request. How can I handle this situation in JMeter. I have already tried 'bzm-Parallel Controller' and it was not success. enter image description here

Deville answered 2/3, 2018 at 20:12 Comment(4)
how about just skipping / disabling that request?Drafty
I am thinking, these request should be included in my test suite to simulate more realistic transactions... So, I cannot avoid those..Deville
so... you want to run it realistically, but not happy that it takes realistic time? what are you trying to achieve?Drafty
hm.. you have a point here Kiril.. But let me explain my concern again.. Long-polling transport request waits till it gets the response from the server. JMeter doesn't execute the rest of the requests till the longpolling request gets the response back. But in real world it doesn't happen. While the requests are waiting for server response, user can do other tasks (or execute some other requests). To overcome this situation I used "bzm-Parallel Controller". But still it waits around 2 minutes. This time adds an extra 2 minutes to transaction response time. That is my problem. Thanks Kiril..!Deville
F
0

You can Insert Parent (Right Click) a Runtime Controller with 1 second, it'll execute your long request, but will wait only 1 second and continue to next requests

Notice that it'll be marked as failed due to java.net.ConnectException

If you want you can add a child JSR223 PostProcessor with the following code to mark it successful

prev.setSuccessful(true);

setSuccessful method can override results status

Fertilizer answered 4/3, 2018 at 7:22 Comment(1)
Great...! Really appreciate it 'User7294900'. It works..!!Deville
S
0

Just add a connect and/or response timeout, it can be done under "Advanced" tab of the HTTP Request sampler.

enter image description here

If you have more than one HTTP Request sampler and want to apply timeout setting to all of them - go for HTTP Request Defaults.

In case you want to mark the HTTP Request which times out as not failed you can go for Response Assertion

enter image description here

Salangia answered 13/2 at 4:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.