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

Function TestWaitForWorkflowTimesOut

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

Source from the content-addressed store, hash-verified

463}
464
465func TestWaitForWorkflowTimesOut(t *testing.T) {
466 // Given a pushed workflow definition that never appears
467 var attempts int
468 var sleeps int
469
470 // When waiting for the workflow by name
471 err := waitForWorkflow(func() ([]string, error) {
472 attempts++
473 return []string{"Other Workflow"}, nil
474 }, "Test Workflow Name", func(time.Duration) {
475 sleeps++
476 })
477
478 // Then the wait stops after one minute
479 require.EqualError(t, err, `workflow "Test Workflow Name" did not register within 60 seconds`)
480 assert.Equal(t, 13, attempts)
481 assert.Equal(t, 12, sleeps)
482}
483
484func TestWaitForRepositoryReady(t *testing.T) {
485 // Given a repository whose initialized default branch appears after creation

Callers

nothing calls this directly

Calls 2

waitForWorkflowFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected