MCPcopy
hub / github.com/containerd/containerd / Eventually

Function Eventually

integration/main_test.go:618–633  ·  view source on GitHub ↗

Eventually waits for f to return true, it checks every period, and returns error if timeout exceeds. If f returns error, Eventually will return the same error immediately.

(f CheckFunc, period, timeout time.Duration)

Source from the content-addressed store, hash-verified

616// returns error if timeout exceeds. If f returns error, Eventually
617// will return the same error immediately.
618func Eventually(f CheckFunc, period, timeout time.Duration) error {
619 start := time.Now()
620 for {
621 done, err := f()
622 if done {
623 return nil
624 }
625 if err != nil {
626 return err
627 }
628 if time.Since(start) >= timeout {
629 return errors.New("timeout exceeded")
630 }
631 time.Sleep(period)
632 }
633}
634
635// Consistently makes sure that f consistently returns true without
636// error before timeout exceeds. If f returns error, Consistently

Callers 15

TestPodUserNSFunction · 0.85
TestIssue10598Function · 0.85
TestLongContainerLogFunction · 0.85
TestAdditionalGidsFunction · 0.85
TestContainerdImageFunction · 0.85
TestWindowsRootfsSizeFunction · 0.85
checkTTYFunction · 0.85
TestWindowsHostProcessFunction · 0.85
TestContainerStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…