(t *testing.T)
| 535 | } |
| 536 | |
| 537 | func TestWaitForWorkflowRunStatus(t *testing.T) { |
| 538 | // Given a workflow run that is registered but still queued |
| 539 | statuses := []string{"queued", "in_progress"} |
| 540 | var sleeps []time.Duration |
| 541 | |
| 542 | // When waiting for the run to start |
| 543 | err := waitForWorkflowRunStatus(func() (string, error) { |
| 544 | status := statuses[0] |
| 545 | statuses = statuses[1:] |
| 546 | return status, nil |
| 547 | }, "in_progress", func(duration time.Duration) { |
| 548 | sleeps = append(sleeps, duration) |
| 549 | }) |
| 550 | |
| 551 | // Then polling continues until cancellation can target the active run |
| 552 | require.NoError(t, err) |
| 553 | assert.Equal(t, []time.Duration{workflowRunStatusPollInterval}, sleeps) |
| 554 | } |
| 555 | |
| 556 | func TestWaitForWorkflowRunStatusStopsWhenRunCompletes(t *testing.T) { |
| 557 | // Given a workflow run that completed before reaching the expected status |
nothing calls this directly
no test coverage detected