randomSwitch with 0 percent probability

Hi,

I found that if the first case in a randomSwitch has 0% probability and the other cases don’t make any http calls, the first chain will still get executed even with 0% probability.
For example,

randomSwitch(
0d → exec(http(“YouTube”).get(“http://www.youtube.com/”)),
50d → doIf(“1”, “2”) {
exec(http(“Google”).get(“http://www.google.ca”))
},
50d → exec()
)

Requests to YouTube is made.
Is that expected? Is 0% not allowed?

Thanks,
Brian

Can’t reproduce.
Then, please abide to the rules for posting here: https://groups.google.com/forum/#!forum/gatling

Sorry for not following the rules. I have checked the documentation and I don’t see anyone ask a similar question.

I’m running 2.1.4, on a Windows 7 64 bit machine.

I have attached my simulation file, which it does only the random switch I posted above.

Again, requests to Youtube is made, even it has 0% probability in a random switch.

Thanks,
Brian

TestSim.scala (444 Bytes)

Code:

randomSwitch( 0.00 -> exec(http("YouTube").get("http://www.youtube.com/")), 50.00 -> exec(http("Google").get("http://www.google.ca")), 50.00 -> exec(http("Github").get("https://github.com/")) )Enter code here...

Result:

This is fine, given that the 2nd and 3rd cases actually make http requests.

However, if the 2nd and 3rd make no http requests (like in my original example), the request with 0% probability is made.

Fixed thanks: https://github.com/gatling/gatling/issues/2544