MCPcopy Create free account
hub / github.com/compozy/agh / waitForCondition

Function waitForCondition

internal/cli/cli_integration_test.go:4135–4146  ·  view source on GitHub ↗
(t *testing.T, timeout time.Duration, fn func() bool)

Source from the content-addressed store, hash-verified

4133}
4134
4135func waitForCondition(t *testing.T, timeout time.Duration, fn func() bool) {
4136 t.Helper()
4137
4138 deadline := time.Now().Add(timeout)
4139 for time.Now().Before(deadline) {
4140 if fn() {
4141 return
4142 }
4143 time.Sleep(10 * time.Millisecond)
4144 }
4145 t.Fatal("timed out waiting for condition")
4146}
4147
4148func waitUntilLeaseExpires(t *testing.T, leaseUntil time.Time, timeout time.Duration) {
4149 t.Helper()

Calls 2

AddMethod · 0.45
NowMethod · 0.45

Tested by

no test coverage detected