Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

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

@kamilkloch

Description

@kamilkloch

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions