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

Method AssertEventuallyResponsesClosed

tailnet/test/peer.go:233–252  ·  view source on GitHub ↗
(expectedError string)

Source from the content-addressed store, hash-verified

231}
232
233func (p *Peer) AssertEventuallyResponsesClosed(expectedError string) {
234 gotErr := false
235 p.t.Helper()
236 for {
237 err := p.readOneResp()
238 if xerrors.Is(err, errResponsesClosed) {
239 if !gotErr && expectedError != "" {
240 p.t.Errorf("responses closed without error '%s'", expectedError)
241 }
242 return
243 }
244 if err != nil && expectedError != "" && err.Error() == expectedError {
245 gotErr = true
246 continue
247 }
248 if !assert.NoError(p.t, err) {
249 return
250 }
251 }
252}
253
254func (p *Peer) AssertNotClosed(d time.Duration) {
255 p.t.Helper()

Calls 5

readOneRespMethod · 0.95
HelperMethod · 0.65
IsMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45