Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the number of expected pods created in e2e test case of "retry" #1996

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,21 @@ func TestTaskRunRetry(t *testing.T) {
}
podNames[r.PodName] = struct{}{}
}
podNames[tr.Status.PodName] = struct{}{}
if len(tr.Status.RetriesStatus) != numRetries {
t.Errorf("TaskRun %q had %d retriesStatuses, want %d", tr.Name, len(tr.Status.RetriesStatus), numRetries)
}

// There should be N Pods created, all failed, all owned by the TaskRun.
pods, err := c.KubeClient.Kube.CoreV1().Pods(namespace).List(metav1.ListOptions{})
// We expect N+1 Pods total, one for each failed and retried attempt, and one for the final attempt.
wantPods := numRetries + 1

if err != nil {
t.Fatalf("Failed to list Pods: %v", err)
} else if len(pods.Items) != numRetries {
} else if len(pods.Items) != wantPods {
// TODO: Make this an error.
t.Logf("BUG: Found %d Pods, want %d", len(pods.Items), numRetries)
t.Logf("BUG: Found %d Pods, want %d", len(pods.Items), wantPods)
}
for _, p := range pods.Items {
if _, found := podNames[p.Name]; !found {
Expand Down