Hello!
Indeed batch + circular fixed the issue.
I don’t know why it won’t work with circular only, I’ll try to explain as best as I can:
So the simulation1 starts with 1 virtual user and creates some data and writes that data into csv file, simulation2 waits for 10 minutes and after that starts with 3 virtual users, reads the data from the csv file using only circular method, the data exists in the csv file so the first virtual user finishes simulation2 successfully. Next v. user should start simulation2, but the execution crashes due to empty feeder - but the data exists in the csv file (only one row, but still exists). I’m expecting to have different data so the v. user 2 from simulation2 should use different data, but if it doesn’t exist, I thought the initial data (same as v. user1) should be used for user2. Because of circular, but after I added batch + circular, it looks fine for now.
public static final ChainBuilder myCall =
feed(csv("data.csv").circular())
.exec(http("Enter data: " + ENDPOINT)
.post(BASE_URL + "/v1/basket")
.formParam(TOKEN, TOKEN_VALUE));
scenarios1.injectOpen(
rampUsersPerSec(0).to(1, 100.0)).during(1800),
constantUsersPerSec(1, 100.0)).during(10)).protocols(httpProtocol),
scenario2.injectOpen(
nothingFor(600),
rampUsersPerSec(0).to(3, 100.0)).during(1800),
constantUsersPerSec(3, 100.0)).during(10)).protocols(httpProtocol)
00:47:49.381 [ERROR] i.g.a.Gatling$ - Run crashed
java.lang.IllegalStateException: Feeder csv(data.csv) is now empty, stopping engine
at io.gatling.core.action.FeedActor$$anonfun$receive$1.applyOrElse(FeedActor.scala:83)
at akka.actor.Actor.aroundReceive(Actor.scala:537)
at akka.actor.Actor.aroundReceive$(Actor.scala:535)
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:25)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:579)
at akka.actor.ActorCell.invoke(ActorCell.scala:547)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
at akka.dispatch.Mailbox.run(Mailbox.scala:231)
at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Initial look of csv file:
Code,BirthDate
Csv file after simulation1 finished:
Code,BirthDate
1223,6-6-1990
Let me know if you need something else.
Cheers