You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the timeout tests fails randomly. In this test we generate 100 timeouts and assert that we got at least more than 70% unique timeout ranges generated. This test fails randomly because we sometimes generate less unique/random timeouts for a given range. There are some possible causes for this:
It could be that our test just makes an assumption that is just way to high, as we only generate timeouts within 150 and 300 but that would still leave 150 possibilities.
In this case, strong randomness isn't important, as it would be in a cryptographic application, for instance. Math.random() isn't great, but it's fast and random enough for the purpose of this library. If you're bent on testing this, perhaps the best way would be to make a random module/function to wrap Math.random() and spy on it during testing to ensure it gets called and the output used.
One of the timeout tests fails randomly. In this test we generate 100 timeouts and assert that we got at least more than 70% unique timeout ranges generated. This test fails randomly because we sometimes generate less unique/random timeouts for a given range. There are some possible causes for this:
150
and300
but that would still leave 150 possibilities.With
Math.random()
analysis like this: https://github.com/nquinlan/better-random-numbers-for-javascript-mirror in the back of heads, it might be wise to come up something more random.The text was updated successfully, but these errors were encountered: