mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
Closes https://github.com/coder/internal/issues/1167 Previously we were checking that start != end time; this was flaking on Windows. On Windows, `time.Now()` has limited resolution (~1ms with Go runtime's `timeBeginPeriod`, or ~15.6ms in default system resolution). When two `time.Now()` calls execute within the same clock tick, they return identical timestamps, causing `StartedAt.Before(EndedAt)` to return `false`. **References:** - [Go issue #8687](https://github.com/golang/go/issues/8687) - Windows system clock resolution issue - [Go issue #67066](https://github.com/golang/go/issues/67066) - time.Now precision on Windows (still open) Instead, we're changing the assertion to (the more semantically correct) "end not before start". A possible future enhancement could be to plumb coder/quartz through the recording mechanism, but it's unnecessary for now. Signed-off-by: Danny Kopping <danny@coder.com>