For example, given there are 5 different scenarios, when the concurrent number is 2, then what I expect is to run 2 scenarios everytime.
I knew how I can run all the scenarios concurrenctly, like
And I just wonder how can I implement such a test scenario:
I can set the concurrency number, e.g, 2, in the code or in some other config file, then the test could run by this concurrency number.
Sorry, I’m not sure to understand the question.
Can you provide what you tried, what you see and what you expected to see?
What I understood is that you want to have scenario run 2 by 2.
Here what might work in that case:
Does that help?
@sbrevet Yes, that does help, thanks for your answer, that’s perfect!
And it’s gonna be better if gatling could provide the ability to read the concurrent number and set up the test scenarios by the framework.
You know, for example, there are 5 different test scenarios, scn1,…scn5, and I just read the user-defined concurrent number from environment variable, properties ,yaml file or something like that.
And I don’t have to build the setUp by myself, I just list all the test scenarios and then they just run by the concurrenty number as expected.
Sorry, but again, I am unsure about what to understand here.
Having a fixed amount of concurrent scenarios is a bit unusual.
It’s the first time I, personally, see such a request.
For your use case, you can pass parameters for your amount of concurrent scenarios.
And build your injection profile with:
val scn1: Scenario = ???
val scn2: Scenario = ???
val scn3: Scenario = ???
val scn4: Scenario = ???
val scn5: Scenario = ???
val allPopulation = List(
val concurrentAmount = Integer.getInteger("concurrentScenarios", 2)
case (acc, current) => acc.andThen(current)
Yeah, thanks @sbrevet . Literally what you understand is all right.
Hope it could help others with the same request.