Skip to content

Commit

Permalink
Correct the number of expected pods created in e2e test case of 'retry'
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pli committed Feb 5, 2020
1 parent aee09da commit 2ca7cd2
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 2ca7cd2

Please sign in to comment.