MCPcopy Create free account
hub / github.com/zalando/skipper / WaitForN

Method WaitForN

proxy/proxy_test.go:126–141  ·  view source on GitHub ↗
(exp string, n int, to time.Duration)

Source from the content-addressed store, hash-verified

124}
125
126func (l *testLog) WaitForN(exp string, n int, to time.Duration) error {
127 timeout := time.After(to)
128 ticker := time.NewTicker(10 * time.Millisecond)
129 defer ticker.Stop()
130
131 for {
132 select {
133 case <-timeout:
134 return fmt.Errorf("timeout waiting for log entry: %s", exp)
135 case <-ticker.C:
136 if l.Count(exp) >= n {
137 return nil
138 }
139 }
140 }
141}
142
143func (l *testLog) WaitFor(exp string, to time.Duration) error {
144 return l.WaitForN(exp, 1, to)

Calls 3

CountMethod · 0.95
ErrorfMethod · 0.65
StopMethod · 0.45

Tested by

no test coverage detected