MCPcopy Create free account
hub / github.com/encodeous/nylon / waitFor

Method waitFor

e2e/harness.go:250–265  ·  view source on GitHub ↗
(nodeName string, source LogSource, pattern string, isRegex bool)

Source from the content-addressed store, hash-verified

248 h.waitFor(nodeName, SourceTrace, pattern, false)
249}
250func (h *Harness) waitFor(nodeName string, source LogSource, pattern string, isRegex bool) {
251 sub, err := h.LogManager.Subscribe(nodeName, source, pattern, isRegex)
252 if err != nil {
253 h.t.Fatalf("failed to subscribe: %v", err)
254 }
255 defer h.LogManager.Unsubscribe(sub)
256
257 select {
258 case <-sub.MatchCh:
259 return
260 case <-time.After(WaitTimeout):
261 h.t.Fatalf("timed out waiting for %s pattern %q in node %s", source, pattern, nodeName)
262 case <-h.ctx.Done():
263 h.t.Fatal("context canceled")
264 }
265}
266
267type managerWriter struct {
268 node string

Callers 3

WaitForLogMethod · 0.95
WaitForMatchMethod · 0.95
WaitForTraceMethod · 0.95

Calls 3

SubscribeMethod · 0.80
UnsubscribeMethod · 0.80
AfterMethod · 0.80

Tested by

no test coverage detected