diff --git a/test/integration/cluster_dns_test.go b/test/integration/cluster_dns_test.go index 1fb3557a00..49ed7f5d06 100644 --- a/test/integration/cluster_dns_test.go +++ b/test/integration/cluster_dns_test.go @@ -47,7 +47,11 @@ func testClusterDNS(t *testing.T) { p := &api.Pod{} for p.Status.Phase != "Running" { - p = kubectlRunner.GetPod(podName, podNamespace) + var err error + p, err = kubectlRunner.GetPod(podName, podNamespace) + if err != nil { + return &commonutil.RetriableError{Err: err} + } } dnsByteArr, err := kubectlRunner.RunCommand([]string{"exec", podName, "--namespace=" + podNamespace, diff --git a/test/integration/mount_test.go b/test/integration/mount_test.go index 0ea2266f91..8cd2d1e6c1 100644 --- a/test/integration/mount_test.go +++ b/test/integration/mount_test.go @@ -70,7 +70,10 @@ func testMounting(t *testing.T) { p := &api.Pod{} for p.Status.Phase != "Running" { - p = kubectlRunner.GetPod(podName, "default") + p, err = kubectlRunner.GetPod(podName, "default") + if err != nil { + return &commonutil.RetriableError{Err: err} + } } path := filepath.Join(tempDir, "frompod") diff --git a/test/integration/persistence_test.go b/test/integration/persistence_test.go index dd91a2b27d..8c95d88b0a 100644 --- a/test/integration/persistence_test.go +++ b/test/integration/persistence_test.go @@ -47,7 +47,10 @@ func TestPersistence(t *testing.T) { } checkPod := func() error { - p := kubectlRunner.GetPod(podName, podNamespace) + p, err := kubectlRunner.GetPod(podName, podNamespace) + if err != nil { + return &commonutil.RetriableError{Err: err} + } if kubectlRunner.IsPodReady(p) { return nil } diff --git a/test/integration/util/util.go b/test/integration/util/util.go index 1736979116..345f94ea86 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -202,10 +202,8 @@ func (k *KubectlRunner) DeleteNamespace(namespace string) error { return err } -func (k *KubectlRunner) GetPod(name, namespace string) *api.Pod { +func (k *KubectlRunner) GetPod(name, namespace string) (*api.Pod, error) { p := &api.Pod{} - if err := k.RunCommandParseOutput([]string{"get", "pod", name, "--namespace=" + namespace}, p); err != nil { - k.T.Fatalf("Error checking pod status: %s", err) - } - return p + err := k.RunCommandParseOutput([]string{"get", "pod", name, "--namespace=" + namespace}, p) + return p, err }