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

Method WaitForNth

testutil/wait_buffer.go:62–66  ·  view source on GitHub ↗

WaitForNth blocks until the accumulated output contains at least n occurrences of signal, or ctx expires. Returns nil on match, ctx.Err() on timeout. Safe to call from any goroutine.

(ctx context.Context, signal string, n int)

Source from the content-addressed store, hash-verified

60// n occurrences of signal, or ctx expires. Returns nil on match,
61// ctx.Err() on timeout. Safe to call from any goroutine.
62func (wb *WaitBuffer) WaitForNth(ctx context.Context, signal string, n int) error {
63 return wb.WaitForCond(ctx, func(s string) bool {
64 return strings.Count(s, signal) >= n
65 })
66}
67
68// WaitForCond blocks until cond returns true for the accumulated
69// output, or ctx expires. Returns nil on match, ctx.Err() on

Callers 3

WaitForMethod · 0.95

Calls 2

WaitForCondMethod · 0.95
CountMethod · 0.80