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

Function TestWaitBuffer_WaitFor_AlreadyPresent

testutil/wait_buffer_test.go:37–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestWaitBuffer_WaitFor_AlreadyPresent(t *testing.T) {
38 t.Parallel()
39 ctx := testutil.Context(t, testutil.WaitShort)
40
41 wb := testutil.NewWaitBuffer()
42 _, err := wb.Write([]byte("already here"))
43 require.NoError(t, err)
44
45 // Signal is already in the buffer; WaitFor returns immediately.
46 require.NoError(t, wb.WaitFor(ctx, "already"))
47}
48
49func TestWaitBuffer_WaitFor_ContextExpired(t *testing.T) {
50 t.Parallel()

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.95
WaitForMethod · 0.95
ContextFunction · 0.92
NewWaitBufferFunction · 0.92

Tested by

no test coverage detected