Right now I'm having difficulty with a custom gatling feeder despite the fact that it's circular. I'm getting this error:
java.lang.IllegalStateException: Feeder is now empty, stopping engine
I'm reading this is the default behavior. However, I want to make sure each user users a different refurl from the feeder: refUrlFeederBuffer.
Also, why isn't it running my after method? I need my cleanup procedures to run regardless of the success or failure of the simulation. If I don't cleanup I can't restart the test!
var refUrlFeeder: Array [Map[String, String]] = Array()
before {
//create stuff and put the refUrls from it in a map
refUrlFeeder = refUrlFeeder :+ Map("refUrl" -> simpleUrl)
}
after {
// delete whatever I created in the before method
// THIS METHOD DOES NOT EXCUTE if the feeder is emptied
// I need it to execute regardless of errors during the scenario
}
object ImportRecords {
val someXml = "<some xml>"
val feeder = RecordSeqFeederBuilder(refUrlFeeder).circular
val update =
feed(feeder)
exec(http("Update stuff")
.put("${refUrl}")
.body(StringBody(someXml))
.asXML
.check(status.is(200))
)
}
val adminUpdaters = scenario("Admins who do updates").exec(ImportRecords.update) setUp(adminUpdaters.inject(atOnceUsers(1)).protocols(httpConf))