mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: update to coder/quartz v0.2.0 (#18007)
Upgrade to coder/quartz v0.2.0 including fixing up a minor API breaking change.
This commit is contained in:
@ -279,10 +279,10 @@ func awaitDoTick(ctx context.Context, t *testing.T, clk *quartz.Mock) chan struc
|
||||
defer trapStop.Close()
|
||||
defer trapNow.Close()
|
||||
// Wait for the initial tick signified by a call to Now().
|
||||
trapNow.MustWait(ctx).Release()
|
||||
trapNow.MustWait(ctx).MustRelease(ctx)
|
||||
// doTick runs here. Wait for the next
|
||||
// ticker reset event that signifies it's completed.
|
||||
trapReset.MustWait(ctx).Release()
|
||||
trapReset.MustWait(ctx).MustRelease(ctx)
|
||||
// Ensure that the next tick happens in 10 minutes from start.
|
||||
d, w := clk.AdvanceNext()
|
||||
if !assert.Equal(t, 10*time.Minute, d) {
|
||||
@ -290,7 +290,7 @@ func awaitDoTick(ctx context.Context, t *testing.T, clk *quartz.Mock) chan struc
|
||||
}
|
||||
w.MustWait(ctx)
|
||||
// Wait for the ticker stop event.
|
||||
trapStop.MustWait(ctx).Release()
|
||||
trapStop.MustWait(ctx).MustRelease(ctx)
|
||||
}()
|
||||
|
||||
return ch
|
||||
|
@ -32,7 +32,7 @@ func TestWatchdog_NoTimeout(t *testing.T) {
|
||||
// right baseline time.
|
||||
pc, err := pubTrap.Wait(ctx)
|
||||
require.NoError(t, err)
|
||||
pc.Release()
|
||||
pc.MustRelease(ctx)
|
||||
require.Equal(t, 15*time.Second, pc.Duration)
|
||||
|
||||
// we subscribe after starting the timer, so we know the timer also starts
|
||||
@ -66,7 +66,7 @@ func TestWatchdog_NoTimeout(t *testing.T) {
|
||||
}()
|
||||
sc, err := subTrap.Wait(ctx) // timer.Stop() called
|
||||
require.NoError(t, err)
|
||||
sc.Release()
|
||||
sc.MustRelease(ctx)
|
||||
err = testutil.TryReceive(ctx, t, errCh)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
@ -88,7 +88,7 @@ func TestWatchdog_Timeout(t *testing.T) {
|
||||
// right baseline time.
|
||||
pc, err := pubTrap.Wait(ctx)
|
||||
require.NoError(t, err)
|
||||
pc.Release()
|
||||
pc.MustRelease(ctx)
|
||||
require.Equal(t, 15*time.Second, pc.Duration)
|
||||
|
||||
// we subscribe after starting the timer, so we know the timer also starts
|
||||
|
Reference in New Issue
Block a user