As I understand in the new WebSocket API it seems that a message is still just checked against a single check.
Taking this example from the docs:
// expecting 2 messages // 1st message will be validated against myCheck1 // 2nd message will be validated against myCheck2 // whole sequence must complete withing 30 seconds exec(ws("Send").sendText("hello") .await(30 seconds)(myCheck1, myCheck2))
The doc says that the first message is only checked against
myCheck1 but not against
myCheck1 is not succeeding for the message.
In my use case I am waiting for 2 messages but I dont know which one will come first, so there is no guarantee or necessity for a given order.
What I would like is to specify multiple checks and each message will be checked against those checks (in the order they are specified) until one check succeeds or no more checks are left.
I am imagining it like this:
- if a check succeeds, it will use the name of this check in the report and will mark the check is succeeded so that its not applied further messages anymore
- if u specify 3 checks, gatling will wait for at least 3 messages to match those checks, the
awaitphase will only stop when all checks succeeded or the timeout expired. This means there could be 10 messages received and checked, if 3 of those messages match the checks the other 7 would be just discarded.
- only if none of the checks succceed or the timeout expires the request is marked KO
Is there a way to get such a behaviour now?
If not, do u think this is a useful feature? cos I would be happy to provide a PR for it.