How can I ignore 500 response status of HTTP requests

Hello, I’m currently using the Java flavor of Gatling 3.11.5.

For some reasons (see How can I customize the error message in the HTML report? if curious) I need to ignore 500 response status for some HTTP requests.

I tried an HTTP check:

.exec(http("My request").get("/some-endpoint")
  .check(status().in(200, 500)));

It does not work, Gatling still considers that the request failed and displays “status.find.is(200), but actually found 500” in the HTML report.

I also tried without success:

status().gt(0)
status().not(0)
status.saveAs("status")

Am I missing something ? How can I ignore selected HTTP statuses such as 500, 400, etc ?

Hello,

Sorry, can’t reproduce.

  {
    setUp(
        scenario("foo")
            .exec(http("Home").get("https://httpbin.org/status/500").check(status().in(200, 500)))
            .injectOpen(atOnceUsers(1))
    );
  }
}

Please provide a reproducer (and upgrade to Gatling 3.12.0).

My bad, there was a .check(status().is(200)) at the HTTP protocol level.

I’ll open a dedicated issue for ideas to “override” such protocol check in request checks.

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