Skip to content

Random not being random enough. #1

@3rd-Eden

Description

@3rd-Eden

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.
  • Our timeout algorithm is flawed.
  • The timeout is flawed.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions