tick sends a tick with the given time and returns the stats from the detector run. It respects context cancellation to avoid blocking forever if the detector exits unexpectedly. tick must not be called from a separate goroutine, as it calls require.FailNow which uses runtime.Goexit under the hood.
(ctx context.Context, now time.Time)
| 72 | // tick must not be called from a separate goroutine, as it calls |
| 73 | // require.FailNow which uses runtime.Goexit under the hood. |
| 74 | func (e *detectorTestEnv) tick(ctx context.Context, now time.Time) jobreaper.Stats { |
| 75 | e.t.Helper() |
| 76 | testutil.RequireSend(ctx, e.t, e.tickCh, now) |
| 77 | return testutil.RequireReceive(ctx, e.t, e.statsCh) |
| 78 | } |
| 79 | |
| 80 | // close stops the detector and waits for it to finish. |
| 81 | func (e *detectorTestEnv) close() { |
no test coverage detected