Core: uniformRandomSwitch with 6 possibilities sometimes executes nothing
See original GitHub issueHi guys,
I think there is a bug in uniformRandomSwitch implementation - when you have i.e. 6 cases defined, sometimes no case is executed at all.
Steps to reproduce:
- Get fresh gatling-sbt-plugin-demo project (Gatling v3.0.3)
- Use below simulation:
class ComputerWorld extends Simulation {
val computerDbScn = scenario("Uniform Random Switch Scenario")
.forever() {
exec(_.reset)
.uniformRandomSwitch(
exec(_.set("foo", 1)),
exec(_.set("foo", 2)),
exec(_.set("foo", 3)),
exec(_.set("foo", 4)),
exec(_.set("foo", 5)),
exec(_.set("foo", 6))
)
.doIf("${foo.isUndefined()}") {
exec(session => {
println("++++++++++ FOO IS UNDEFINED ++++++++++")
session
})
}
}
setUp(
computerDbScn.inject(atOnceUsers(1))
.protocols(http.baseUrl("http://computer-database.gatling.io"))
)
}
- Execute simulation, i.e.
sbt "gatling:testOnly *ComputerWorld"
Actual:
There are many executions where variable foo
is not defined after executing uniformRandomSwitch.
Expected: uniformRandomSwitch should make sure to always execute one of defined cases.
Cheers, Adam
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Scenario - Gatling
How to define scenarios that your virtual users will execute. Use exec to attach a chain or execute a request or a function....
Read more >CONCEPTS IN RELIABLE AND OPTIMAL SYSTEMS DESIGNS
Sometimes this technique is referred to as energy minimization wherein the concept is ... evolution is searching a constantly changing set of possibilities....
Read more >2014 - jmeter
Execution Phase: In this phase tests are executed and results are generated for the analysis phase. It is assumed that the setup phase...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aartajew As I said, I wasn’t satisfied with the existing implementation. New ones looks way better (and has unit tests…).
I think there is a simpler solution, please see the comment below: