(t *testing.T)
| 133 | } |
| 134 | |
| 135 | func TestWaitBuffer_WaitFor_BackgroundGoroutine(t *testing.T) { |
| 136 | t.Parallel() |
| 137 | |
| 138 | ctx, cancel := context.WithCancel(context.Background()) |
| 139 | cancel() // Expire immediately. |
| 140 | |
| 141 | wb := testutil.NewWaitBuffer() |
| 142 | |
| 143 | // WaitFor from a background goroutine should return the |
| 144 | // context error rather than calling t.Fatal. |
| 145 | done := make(chan error, 1) |
| 146 | go func() { |
| 147 | done <- wb.WaitFor(ctx, "never") |
| 148 | }() |
| 149 | |
| 150 | err := <-done |
| 151 | require.ErrorIs(t, err, context.Canceled) |
| 152 | } |
| 153 | |
| 154 | func TestWaitBuffer_SequentialWaits(t *testing.T) { |
| 155 | t.Parallel() |
nothing calls this directly
no test coverage detected