I’m trying to replicate some production issues and want to recreate the arrivals of users in a simulation
I have a list of intervals between each arrival from production logs, and I want to inject a user, then nothingFor the interval, then inject the next user etc
I have the intervals in
var arrivalIntervals: Seq[FiniteDuration]
and in setUp I want to do
arrivalIntervals.flatMap(interval =>List(nothingFor(interval),atOnceUsers(1)))
but this is results in just one user being injected despite there being many entries in arrivalIntervals. No errors are displayed
When I prtinln the the arrivalIntervals.flatMap… function the log has
`
List(NothingForOpenInjection(0 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1), NothingForOpenInjection(60 seconds), AtOnceOpenInjection(1))
`
If I cut and paste this into the setup() block in place of my flatMap function, it works as expected!