Hacker News new | past | comments | ask | show | jobs | submit login

Yep; I definitely log the seed and re-seed every few seconds.

Most software I work on these days is non-deterministic anyway (it involves the network, etc.), so CI is fundamentally going to fail some runs and not others.

Even stuff like deterministic simulation has this property: Those test suites rely on having a large number of randomly generated schedules, so there's always a chance that running the test one more time (with a new seed) will find a new bug.




If you’re using Git, I’d strongly recommend the hash of the current tree (not the commit). That way your tests are deterministic based on the contents of your tree. For example, if you add a commit and then revert, you’ll end up with the same test seed as if you hadn’t committed.


The important thing to log is the seed passed to the rng. (It’s usually wallclock time measured at nanosecond granularity.)

In a typical night for a production quality system, 100-1000+ hours of such tests would run, all with different seeds, and in diverse configurations, etc, so the seed isn’t derived from the git sha, or the source code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: