Polling for the second Request does not work

Hi ,

Its been more than a week that i have failed to invoke a subsequent second GET call in my Scenario.
The GET call is not being made .
The scenario first does a POST request on a API which is asynchronous and starts to run a Job.
I am required to make a second GET call to know the status of the job that was triggered by the first POST call.
I am using the uniqueId ( UID) generated from the first POST call to know the latest status , using the GET call.
Below is the implementation and i see that the GET call is not being invoked. I am starting to think if this is a Bug.
The reason why i am think that this could be a Bug is because i am able to see the GET call being made when i replace the Polling with tryMax.
just for your information , i have posted the implementation using tryMax at the Bottom.

val scn: ScenarioBuilder = scenario("Stress test scenario for records_included=All")
  .feed(feeder.customFeeder)
  .repeat(3, "counterName") {
    doWhile("$execState".equals("COMPLETED")) {
      exec(http("Submit Alerts for Execution").post("/_execute/?wait_for_completion_seconds=0")
        .body(StringBody(execution))
        .check(status.is(200))
        //.check(substring("COMPLETED").exists)
        .check(jsonPath("$.uid").saveAs("execUID")))
        .pause(1)
        .exec(session => {
          execUID = session("execUID").as[String]
          println("execUID ( Var ) :>>>>>>>>>>" + execUID)
          //println(session)
          session.set("temp","temp")
        })
        .exec(
          polling
            .every(15 )
            .exec(http("Retrieve Execution Status").get("/_execute/"+"${execUID}"+"?wait_for_completion_seconds="+TestConfig.duration)
              .check(status.is(200))
              .check(jsonPath("$.state").saveAs("execState"))
              .check(bodyString.saveAs("BODY"))
              .check(substring("COMPLETED").exists))
        )
        .exec(session => {
          val response = session("BODY").as[String]
          println(s"GET Response body ----*****: \n$response")
          session
        })
    }
  }
setUp(
  scn.inject(atOnceUsers(TestConfig.usersFile))
).protocols(httpConf)


Below is the implementation using tryMax.I am able to see the GET call being made using the below implementation.


i would be very grateful if someone can help me with this.

I am still hoping that someone would explain why the GET request is not invoked during polling

Hi Madhana,
Can you help me with below.
Regards
Akshay

It seems polling is not working as specified in documentation, you can use below code for work around.

step 1: Create concurrent linked queue
val queue = new ConcurrentLinkedQueue[String]
step 2: Add number of times you would like to poll or status check or any variable.
queue.add(session(“poll_count”).as[String])
Step 3: poll_count = queue.poll()

.asLongAs(session => session(“poll_count”).as[String] != “null”){
exec(http(“Retrieve Execution Status”).get("/_execute/"+"${execUID}"+"?wait_for_completion_seconds="+TestConfig.duration)
.check(status.is(200))
.check(jsonPath("$.state").saveAs(“execState”))
.check(bodyString.saveAs(“BODY”))
.check(substring(“COMPLETED”).exists))
}
exec(session => {
poll_count = poll_count-1
session
})