testy: fix clock initialization when Start is provided.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2020-04-17 13:19:41 -07:00
parent ccfc4e0634
commit 42e62a7eb2
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ func (c *Clock) Now() time.Time {
defer c.Unlock()
if c.Start.IsZero() {
c.Start = time.Now()
}
if c.Present.Before(c.Start) {
c.Present = c.Start
}
step := c.Step