MCPcopy
hub / github.com/stretchr/testify / WaitUntil

Method WaitUntil

mock/mock.go:158–163  ·  view source on GitHub ↗

WaitUntil sets the channel that will block the mock's return until its closed or a message is received. Mock.On("MyMethod", arg1, arg2).WaitUntil(time.After(time.Second))

(w <-chan time.Time)

Source from the content-addressed store, hash-verified

156//
157// Mock.On("MyMethod", arg1, arg2).WaitUntil(time.After(time.Second))
158func (c *Call) WaitUntil(w <-chan time.Time) *Call {
159 c.lock()
160 defer c.unlock()
161 c.WaitFor = w
162 return c
163}
164
165// After sets how long to block until the call returns
166//

Callers 2

Test_WaitUntil_ParallelFunction · 0.80

Calls 2

lockMethod · 0.95
unlockMethod · 0.95

Tested by 2

Test_WaitUntil_ParallelFunction · 0.64