RequireWaitFor blocks until the accumulated output contains signal or ctx expires. On timeout, fails the test with a message showing what was expected and what was written so far. Safety: Must only be called from the Go routine that created `t`.
(ctx context.Context, t testing.TB, signal string)
| 96 | // Safety: Must only be called from the Go routine that created |
| 97 | // `t`. |
| 98 | func (wb *WaitBuffer) RequireWaitFor(ctx context.Context, t testing.TB, signal string) { |
| 99 | t.Helper() |
| 100 | if err := wb.WaitFor(ctx, signal); err != nil { |
| 101 | t.Fatalf("WaitBuffer: signal %q not found; buffer contents:\n%s", signal, wb.String()) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // Bytes returns a copy of the accumulated output. |
| 106 | func (wb *WaitBuffer) Bytes() []byte { |