advanceUntil advances the mock clock one event at a time until done returns true. Because the snapshot TickerFunc is always pending and WaitFor reuses a single timer via Reset, there is always at least one event to advance.
(ctx context.Context, t *testing.T, mClock *quartz.Mock, done func() bool)
| 71 | // true. Because the snapshot TickerFunc is always pending and WaitFor reuses a |
| 72 | // single timer via Reset, there is always at least one event to advance. |
| 73 | func advanceUntil(ctx context.Context, t *testing.T, mClock *quartz.Mock, done func() bool) { |
| 74 | t.Helper() |
| 75 | for !done() { |
| 76 | select { |
| 77 | case <-ctx.Done(): |
| 78 | t.Fatal("context cancelled waiting for condition") |
| 79 | default: |
| 80 | } |
| 81 | _, w := mClock.AdvanceNext() |
| 82 | w.MustWait(ctx) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // sendAndAdvance calls Send() in a goroutine and advances the mock clock until |
| 87 | // Send completes. |
no outgoing calls
no test coverage detected