Are repeat loops executed synchronously or async?

Are all of the tests inside a repeat loop executed synchronously or async? What I am wondering if I have a repeat of 10, will that fire up 10 separate async messages in a parallel or will it wait for each one to finish before it finishes? As well how many connections does 1 virtual user open when I use repeat in a scenario? Also, if 1 user repeats one POST request, does the user then open new connections for each POST request or is the first established Keep-Alive connection used for consecutive requests?

As an example here is the basic outline of the test scenario:

exec(
exec { session =>
repeat(10, “n”) {

exec(
exec {
http(“write”)
.post("/write")
.body(StringBody("""{ “contactid”: ${contactid}, “version”: ${version}, “transactionId”: “3248”}"""))
.check(bodyString.transform(x => MyTest.applied(x)).saveAs(“applied”))
},
exec(session =>
session.set(“version”, session(“version”).as[Int] + 1)),
)

},
doIf("${applied}") {
exec {

http(“versions”)
.get("/all/${contactid}")
.check(bodyString.transformOption(x => MyTest.checkVersion(x)).is(10))
}
}
)

Thank you,
Ryan

Are all of the tests inside a repeat loop executed synchronously or async?

Those are not “tests” but a chain of actions.
Sequentially for each virtual user. The only Gatling component that perform requests concurrently is “resources”.

how many connections does 1 virtual user open when I use repeat in a scenario

By default, regarding connections, each virtual user will behave like an individual web browser, with keep-alive support enabled.
See HttpProtocol documentation for changing configuration.