Gatling retry request

Hi,
I have a below request

    val saml = scenario("ACM Token")
      .exec(http("SP")
        .post("https://xxxxxx/api/saml")
        .header("Content-Type", "application/x-www-form-urlencoded")
        .header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36")
        .header("Accept-Encoding", "gzip, deflate, br")
        .formParam("RelayState", Configuration.relayState)
        .formParam("SAMLResponse", Configuration.saml)
      )
      .exec(getCookieValue(CookieKey("acmToken").withDomain("xxxx").withPath("/")))
      .exec { session =>
        val token = session("acmToken").as[String]
        val token2 = "Bearer " + token
        session.set("acmToken", token2)
      }
      .exec(session => {
        System.setProperty("acmToken", session("acmToken").as[String])
        session
      })

which is failing randomly when user count is increased and below error is seen

io.gatling.http.client.impl.RequestTimeoutException: Request timeout to xxxx.com/10.161.134.82:443 after 60000 ms
21:40:10.610 [DEBUG] i.g.h.e.r.DefaultStatsProcessor - Request 'SP' failed for user 462: Request timeout to xxxx.com/10.161.134.82:443 after 60000 ms
>>>>>>>>>>>>>>>>>>>>>>>>>>
Request:
SP: KO Request timeout to xxxx.com/10.161.134.82:443 after 60000 ms

how can i retry this saml request till the domain is reachable?

Use tryMax: https://gatling.io/docs/gatling/reference/current/core/scenario/#trymax

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.