MCPcopy Index your code
hub / github.com/coder/coder / tick

Method tick

coderd/jobreaper/detector_test.go:74–78  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

72// tick must not be called from a separate goroutine, as it calls
73// require.FailNow which uses runtime.Goexit under the hood.
74func (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.
81func (e *detectorTestEnv) close() {

Calls 3

RequireSendFunction · 0.92
RequireReceiveFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected