MCPcopy
hub / github.com/docker/compose / WaitForCondition

Method WaitForCondition

pkg/e2e/framework.go:456–471  ·  view source on GitHub ↗

WaitForCondition wait for predicate to execute to true

(
	t testing.TB,
	predicate func() (bool, string),
	timeout time.Duration,
	delay time.Duration,
)

Source from the content-addressed store, hash-verified

454
455// WaitForCondition wait for predicate to execute to true
456func (c *CLI) WaitForCondition(
457 t testing.TB,
458 predicate func() (bool, string),
459 timeout time.Duration,
460 delay time.Duration,
461) {
462 t.Helper()
463 checkStopped := func(logt poll.LogT) poll.Result {
464 pass, description := predicate()
465 if !pass {
466 return poll.Continue("Condition not met: %q", description)
467 }
468 return poll.Success()
469 }
470 poll.WaitOn(t, checkStopped, poll.WithDelay(delay), poll.WithTimeout(timeout))
471}
472
473// Lines split output into lines
474func Lines(output string) []string {

Callers 3

TestComposeCancelFunction · 0.80
TestAttachRestartFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestComposeCancelFunction · 0.64
TestAttachRestartFunction · 0.64