The function works, but the parameter may result in a weighted answer. Internally the function generates a random number between 0 and 100 and compare that against your parameter. If the random number is less than your parameter, then it returns true, otherwise it returns false. If your parameter is 33, then the random result will more likely be false (only true 33% of the time). Try and input the parameter 50 and you're likely to get a more varied answer.
Also note that 10 false out of 10 tries is not an indicator of non-randomness as each event is independent of each other. If I flip a fair coin (50% chances of head). I still might get a streak of 10 tails in a row.
Posted: 7 years ago
Posted: 15 Jun 2016 6:06 EDT
Matthew Morency (morem)
Senior Principal Cloud Security Engineer
Are you trying to execute this from SLA/wait/Agent . If yes, every time it is executed by SLA/Agent the function will be executed freshly and my understanding is it will not store this value anywhere. So every retry from agent/sla will not give 33% true. I think this is expected behavior.