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

Function waitUntilLeaseExpires

internal/cli/cli_integration_test.go:4148–4166  ·  view source on GitHub ↗
(t *testing.T, leaseUntil time.Time, timeout time.Duration)

Source from the content-addressed store, hash-verified

4146}
4147
4148func waitUntilLeaseExpires(t *testing.T, leaseUntil time.Time, timeout time.Duration) {
4149 t.Helper()
4150
4151 ctx, cancel := context.WithTimeout(context.Background(), timeout)
4152 defer cancel()
4153 ticker := time.NewTicker(10 * time.Millisecond)
4154 defer ticker.Stop()
4155
4156 for {
4157 if time.Now().After(leaseUntil) {
4158 return
4159 }
4160 select {
4161 case <-ctx.Done():
4162 t.Fatalf("timed out waiting for lease expiry at %s", leaseUntil.Format(time.RFC3339Nano))
4163 case <-ticker.C:
4164 }
4165 }
4166}

Calls 3

StopMethod · 0.65
DoneMethod · 0.65
NowMethod · 0.45

Tested by

no test coverage detected