I have a scenario where web clients poll a server. Depending on the data in the response they are granted/denied access to certain resources. The clients dynamically react to those changes and the user is shown either the resources or some waiting page (denied). This is done via long polling mechanism. If the resources are available the user can interact e.g. answer a question.
I have a test plan that incorporates this long polling mechanism. I initially tried adding the polling into a request-loop to simulate it according to the real clients but my requests then got delayed until the long polling request got a response.
Thread group
|
|- Get State from server (saves value in variable) - no long polling here
|- Request loop
| |- If Controller (checks the variable)
|- Loop until all resources are processed
|- Get State - long poll **this blocks the user response until the timeout for the server response is met**
|- User response
I then tried running the polling in a separate loop. However the request-loop seems to be never entered any more when the the polling-loop is executed. I checked with a Debug Sampler that the variable is indeed changed by the polling-loop whenever something changes on the server.
Thread group
|
|- Get State from server (saves value in variable) - no long polling here
|- Request loop
| |- If Controller (checks the variable)
| |- Loop until all resources are processed
| |- User response
|
|- Long-polling loop
| |- Set variable
Is there a solution that would nearly map the real scenario?