Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP: Add possibility to consume and check against an undefined number of websocket messages #4440

Open
kamilkloch opened this issue Jul 6, 2023 · 2 comments

Comments

@kamilkloch
Copy link

Currently, Gatling's WebSocket DSL expects you to define the number of expected messages: https://gatling.io/docs/gatling/reference/current/http/websocket/#set-a-check.

ws("Subscribe for updates")
  .sendText("")
  .await(10.seconds)(check1, ..., checkN)

In other words, you can create many checks with a method and a loop, but it has to be a finite loop with a fixed number of iterations.

A typical scenario for a websocket test is to subscribe to an infinite stream of updates on some event type (e.g. account update) and then perform checks on the received messages - something akin to

ws("Subscribe for updates")
  .sendText("")
  .during(10.seconds)(check) // keep consuming messages for 10 seconds, perform check

This is currently not possible.

@slandelle
Copy link
Member

I'm suspect this would require some heavy changes.
Is this something you'd be interested in contributing or sponsoring?

@slandelle slandelle changed the title Add possibility to consume and check against an undefined number of websocket messages HTTP: Add possibility to consume and check against an undefined number of websocket messages Sep 7, 2023
@kamilkloch
Copy link
Author

@slandelle I am afraid I will not be able to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants