(check func() (bool, error), sleep func(time.Duration))
| 182 | } |
| 183 | |
| 184 | func waitForRepositoryReady(check func() (bool, error), sleep func(time.Duration)) error { |
| 185 | for attempt := 0; attempt < repositoryReadyPollAttempts; attempt++ { |
| 186 | ready, err := check() |
| 187 | if err != nil { |
| 188 | return err |
| 189 | } |
| 190 | if ready { |
| 191 | return nil |
| 192 | } |
| 193 | if attempt < repositoryReadyPollAttempts-1 { |
| 194 | sleep(repositoryReadyPollInterval) |
| 195 | } |
| 196 | } |
| 197 | return errors.New("repository did not finish initializing within 30 seconds") |
| 198 | } |
| 199 | |
| 200 | func waitForWorkflowRunStatus(view func() (string, error), expected string, sleep func(time.Duration)) error { |
| 201 | for attempt := 0; attempt < workflowRunStatusPollAttempts; attempt++ { |
no test coverage detected