tstest: prepare for Clock API changes

This change introduces tstime.NewClock and tstime.ClockOpts as a new way
to construct tstime.Clock. This is a subset of #8464 as a stepping stone
so that we can update our internal code to use the new API before making
the second round of changes.

Updates #8463

Change-Id: Ib26edb60e5355802aeca83ed60e4fdf806c90e27
Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
This commit is contained in:
Adrian Dewhurst
2023-07-06 16:09:24 -04:00
committed by Adrian Dewhurst
parent fd8c8a3700
commit cd4c71c122
4 changed files with 95 additions and 21 deletions

View File

@@ -36,9 +36,9 @@ func init() {
}
func newResolver(tb testing.TB) *Resolver {
clock := &tstest.Clock{
clock := tstest.NewClock(tstest.ClockOpts{
Step: 50 * time.Millisecond,
}
})
return &Resolver{
Logf: tb.Logf,
timeNow: clock.Now,