# tryMax retrying even if there is no fail in the loop

**URL:** https://community.gatling.io/t/trymax-retrying-even-if-there-is-no-fail-in-the-loop/1952
**Category:** Gatling (Open-Source)
**Created:** [January 30, 2015, 9:50am UTC](https://community.gatling.io/t/trymax-retrying-even-if-there-is-no-fail-in-the-loop/1952 "2015-01-30T09:50:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Simon\_Gaestel](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Simon\_Gaestel](https://community.gatling.io/u/Simon_Gaestel)
#### Post date: [January 30, 2015, 9:50am UTC](https://community.gatling.io/t/trymax-retrying-even-if-there-is-no-fail-in-the-loop/1952/1 "2015-01-30T09:50:56Z")

</div>

Hello,

I am using Gatling 2.1.4 to perform performance testing on our product and am facing an issue I don’t understand.  
During the simulation, I have a scenario executing with multiple clients.  
However, sometimes when a request fail for a client, all tryMax loops perform the retries even if there is no fail check in the loop.

Here is a sample of my project that is failing :

**a.scala**

`

object objectA {

val objectAchain =

exec(  
http(“Request A”)  
.get(“url\_a”)  
.check(jsonPath("$.items[0].uid").saveAs(“objectsA”)))

}

`

**b.scala**

`

object objectB {

val objectBchain =

exec(session =\> session.remove(“successfully”))

.tryMax(10) {  
exec(  
http(“Request b”)  
.post(“url\_b”)  
.check(status.is(200).saveAs(“successfully”)))  
}  
}

`

**c.scala**  
  
**`**

 

class mySimulation extends Simulation {

val myScenarioChain =  
repeat(10) {  
exec(objectAchain)  
.exec(objectBchain)  
}

val myScenario = scenario(“myScenario”)  
.exec(myScenarioChain)

setUp(myScenario.inject(rampUsers(30) over (60 seconds)))  
}

**`**

So when “Request a” fail for a client, all following “Request b” are retried 10 times, whereas the requests are OK.

Do you have any idea why this can happen ?  
Not sure about that, but I think I never had this problem when using Gatling 1.5.6.

Thanks in advance for your help.

---

<div class="post-metadata">

### Author: ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)
#### Post date: [January 30, 2015, 11:13am UTC](https://community.gatling.io/t/trymax-retrying-even-if-there-is-no-fail-in-the-loop/1952/2 "2015-01-30T11:13:56Z")

</div>

It was indeed a bug: [https://github.com/gatling/gatling/issues/2541](https://github.com/gatling/gatling/issues/2541)

Thanks for reporting!
