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

Method RequireWaitFor

testutil/wait_buffer.go:98–103  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

96// Safety: Must only be called from the Go routine that created
97// `t`.
98func (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.
106func (wb *WaitBuffer) Bytes() []byte {

Callers 2

TestAgentScriptFunction · 0.95

Calls 4

WaitForMethod · 0.95
StringMethod · 0.95
HelperMethod · 0.65
FatalfMethod · 0.45

Tested by 2

TestAgentScriptFunction · 0.76