MCPcopy Create free account
hub / github.com/cli/cli / TestWaitForRepositoryReadyTimesOut

Function TestWaitForRepositoryReadyTimesOut

acceptance/acceptance_test.go:503–520  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

501}
502
503func TestWaitForRepositoryReadyTimesOut(t *testing.T) {
504 // Given a repository whose default branch remains unavailable
505 var attempts int
506 var sleeps int
507
508 // When waiting for repository initialization to finish
509 err := waitForRepositoryReady(func() (bool, error) {
510 attempts++
511 return false, nil
512 }, func(time.Duration) {
513 sleeps++
514 })
515
516 // Then the wait stops after thirty seconds
517 require.EqualError(t, err, "repository did not finish initializing within 30 seconds")
518 assert.Equal(t, 31, attempts)
519 assert.Equal(t, 30, sleeps)
520}
521
522func TestWaitForRepositoryReadyReturnsUnexpectedError(t *testing.T) {
523 // Given a repository readiness check that fails unexpectedly

Callers

nothing calls this directly

Calls 2

waitForRepositoryReadyFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected