Possible bug in uniformRandomSwitch

I have a couple of scenarios that make use of uniformRandomSwitch that fail with a runtime error on startup, claiming that you can’t do a randomSwitch where the weights add up to more than 100.

One of them, I know, has 6 options. So if I had to guess what is happening, I suppose that there is a rounding error that causes the weights to add up to just a HINT more than 100, so the underlying implementation complains.

Not sure what the fix should be. Maybe if randomSwitch adds up to more than 100, but less than 101, it is okay?

That’s weird, because we actually compute the first weight as 100.0 minus the other ones, so this shouldn’t happen (and I haven’t been able to reproduce so far…).

OK, I could reproduce.
Will fix.

Fixed: https://github.com/gatling/gatling/issues/2250

Thanks for reporting