I found a large number of authors are writing tests that depend on the deterministic time returned by NewFakeClock. I found this out the hard way when I upgraded us to https://github.com/jonboulle/clockwork/pull/52, which changed this default.
I believe using a deterministic time when none is specified is an anti-pattern. If a test requires a deterministic time, authors should use NewFackClockAt to make the timestamp requirement explicit. This is similar to how Go's map iterating order is non-deterministic.
I made https://github.com/jonboulle/clockwork/pull/55 as a suggestion, which uses a random time from the year 1970 (excluding the Unix epoch time), but I am open to other thoughts/suggestions.
I found a large number of authors are writing tests that depend on the deterministic time returned by
NewFakeClock
. I found this out the hard way when I upgraded us to https://github.com/jonboulle/clockwork/pull/52, which changed this default.I believe using a deterministic time when none is specified is an anti-pattern. If a test requires a deterministic time, authors should use
NewFackClockAt
to make the timestamp requirement explicit. This is similar to how Go's map iterating order is non-deterministic.I made https://github.com/jonboulle/clockwork/pull/55 as a suggestion, which uses a random time from the year 1970 (excluding the Unix epoch time), but I am open to other thoughts/suggestions.