TryMax without marking scenario as failed

583 views
Skip to first unread message

Mateusz Gruszczyński

unread,
Nov 27, 2015, 5:17:04 AM11/27/15
to Gatling User Group
Hi, 

is there any simple and clean way to force tryMax() not to fail whole scenario if request failed few first times? 

The case is that I have a request that may succeed or may fail depending on how fast system will register changes and since it works asynchronously, then sometimes it may take 1 second, sometimes (especially with big load) even 10 seconds and I don't know if its done until i ask for resource data. Simplest solution is to add implicit pause() but with dozens of such scenarios it increases tests duration from 2-3 minutes to even 10 minutes.

I tried to use tryMax() but it will mark scenario as failed if any of attempts failed. Of course i can use doIf, add some checking, save results to session attribute and than loop until system response will contain expected data but in my cases it will require storing a lot of extra attributes in session and writing lot of scenario-specific code, so i rather would use some generic solution.

Stéphane LANDELLE

unread,
Nov 30, 2015, 8:07:02 AM11/30/15
to gat...@googlegroups.com
Sorry, I don't get you.

Do you mean that tryMax switch status to failed even thought the last attempt was successful?

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mateusz Gruszczyński

unread,
Dec 3, 2015, 7:23:43 AM12/3/15
to Gatling User Group
I'm looking for something that mark scenario as passed if any of attempts 1st, 10th, 100th etc. was succesfull. From what I see tryMax will will cause whole scenario fail if it wont success in first attempt. For example:

1. We add new user to system (elastic is indexing that change)
2. Now we tryMax(10) and search user than check number of results == 1:
  2.1. We got empty results (elastic do not have indexed changes yet), check fails
  2.2. Now we got result as elastic indexed changes, check pass

Since first attempt in tryMax failed - then whole scenario is market as failed. But since I can accept that few first attempts fail than I'm looking for something that fail scenario only if all attempts fail. I've manage to do it with asLongAs but in some cases it requires to save dozens of session attributes and then check all those attributes in loop condition so it in quite nasty solution.

Stéphane LANDELLE

unread,
Jan 13, 2016, 8:04:46 AM1/13/16
to gat...@googlegroups.com
No, tryMax will mark the session as failed only when the last attempt fails.

Stéphane Landelle
GatlingCorp CEO


Message has been deleted
Message has been deleted

Stéphane LANDELLE

unread,
Apr 6, 2016, 3:05:37 PM4/6/16
to gat...@googlegroups.com
Please don't highjack an old unrelated thread.
Create a new one and explain your problem. Don't forget to first test if you're not running an old version and upgrading fixes it.

Stéphane Landelle
GatlingCorp CEO


On Tue, Apr 5, 2016 at 8:43 PM, TK <kalet...@gmail.com> wrote:
 Do we have any update on this please?

Regards
Tarun


On Monday, April 4, 2016 at 3:11:20 PM UTC-7, TK wrote:
Just to cross check my understanding, Are we going to mark the request as failed only if all the attempts are failed under tryMax loop?
If yes, then i am seeing some different behavior with tryMax. The failure attempts are also being logged under "KO" section even if the request would have passed in different attempt. I mean if the request is passed in 4th attempt but all the previous 3 attempts are being logged under "KO" section which is misleading the overall error rate. Kindly clarify

Please correct me if i am missing anything here. Thanks a lot in advance for looking into this.


Regards
Tarun
Reply all
Reply to author
Forward
0 new messages