Scenario doesn't fail on check fail?

19 views
Skip to first unread message

Sergey Dashko

unread,
Apr 25, 2017, 7:12:32 AM4/25/17
to Gatling User Group
I'm wondering why my scenario always shows as successful even if I check for status 500, 400, etc.
Here is my code:

        http("ConvertToDate")
          .body(StringBody(bd)).asJSON
          .check(status.is(500))

Regards,
Sergey

Sergey Dashko

unread,
Apr 25, 2017, 10:16:37 AM4/25/17
to Gatling User Group
I've found that this happened when I run this code together with other exec in chain:
If I run:

  val scn = scenario("ConvertToDate").exec(
    ConvertToDate.test()
  )

object ConvertToDate {
  def test() =
  exec(
        http("ConvertToDate")
          .post("/jobs?sync=true&timeout=300")
          .body(StringBody(body("dfdsdsds"))).asJSON
          .check(status.is(500))
)

test failed as it should but if add another copy of test function:

  val scn = scenario("ConvertToDate").exec(
    ConvertToDate.test(),
    ConvertToDate.test()
  )

test run successfully

What I missed here?

вторник, 25 апреля 2017 г., 14:12:32 UTC+3 пользователь Sergey Dashko написал:
Reply all
Reply to author
Forward
0 new messages