Metriche repository
- Star
- (6902 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
I am trying to use gatling to test an SSE endpoint that represents an update stream. To properly test this, I want to open the SSE stream, issue a normal HTTP request that triggers an update, then check that the SSE client has received the update event. My code looks something like this:
[...]
.exec(openSseStream)
.exec(triggerUpdate)
.exec(checkUpdateInSseStream)
[...]
My problem is that if the update message is sent to the SSE client very quickly, it might already be consumed and ignored by the time the check is activated.
I can think of three possible ways to solve this:
- make the check non-blocking, so I can activate the check before I trigger the update
- add an API to specify an
ActionBuilderwith thesetCheckso that the action will be executed after the check is set up but before it blocks further execution - add an option to buffer incoming SSE messages while no check is active and "replay" them as soon as a check is set up
If necessary, I can build a sample application that demonstrates the problem, but I hope it's already clear from the explanation.