(t *testing.T)
| 501 | } |
| 502 | |
| 503 | func 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 | |
| 522 | func TestWaitForRepositoryReadyReturnsUnexpectedError(t *testing.T) { |
| 523 | // Given a repository readiness check that fails unexpectedly |
nothing calls this directly
no test coverage detected