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

Function waitForWorkflow

acceptance/acceptance_test.go:166–182  ·  view source on GitHub ↗
(list func() ([]string, error), expected string, sleep func(time.Duration))

Source from the content-addressed store, hash-verified

164}
165
166func waitForWorkflow(list func() ([]string, error), expected string, sleep func(time.Duration)) error {
167 for attempt := 0; attempt < workflowPollAttempts; attempt++ {
168 workflows, err := list()
169 if err != nil {
170 return err
171 }
172 for _, workflow := range workflows {
173 if workflow == expected {
174 return nil
175 }
176 }
177 if attempt < workflowPollAttempts-1 {
178 sleep(workflowPollInterval)
179 }
180 }
181 return fmt.Errorf("workflow %q did not register within 60 seconds", expected)
182}
183
184func waitForRepositoryReady(check func() (bool, error), sleep func(time.Duration)) error {
185 for attempt := 0; attempt < repositoryReadyPollAttempts; attempt++ {

Callers 3

TestWaitForWorkflowFunction · 0.85
sharedCmdsFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected