Merge pull request #33811 from pmorie/e2e-ns-cleanup

Automatic merge from submit-queue

Make E2E tests easier to debug

This PR removes deferred deletion calls in E2E tests in order to make test easier to debug.  Some of these tests predate namespace finalization; we should just rely on that mechanism to ensure that framework test artifacts are deleted.
This commit is contained in:
Kubernetes Submit Queue
2016-10-17 13:29:41 -07:00
committed by GitHub
12 changed files with 7 additions and 120 deletions

View File

@@ -2145,16 +2145,15 @@ func (f *Framework) MatchContainerOutput(
podClient := f.PodClient()
ns := f.Namespace.Name
defer podClient.Delete(pod.Name, api.NewDeleteOptions(0))
podClient.Create(pod)
createdPod := podClient.Create(pod)
// Wait for client pod to complete.
if err := WaitForPodSuccessInNamespace(f.Client, pod.Name, ns); err != nil {
if err := WaitForPodSuccessInNamespace(f.Client, createdPod.Name, ns); err != nil {
return fmt.Errorf("expected pod %q success: %v", pod.Name, err)
}
// Grab its logs. Get host first.
podStatus, err := podClient.Get(pod.Name)
podStatus, err := podClient.Get(createdPod.Name)
if err != nil {
return fmt.Errorf("failed to get pod status: %v", err)
}
@@ -2163,7 +2162,7 @@ func (f *Framework) MatchContainerOutput(
podStatus.Spec.NodeName, podStatus.Name, containerName, err)
// Sometimes the actual containers take a second to get started, try to get logs for 60s
logs, err := GetPodLogs(f.Client, ns, pod.Name, containerName)
logs, err := GetPodLogs(f.Client, ns, podStatus.Name, containerName)
if err != nil {
Logf("Failed to get logs from node %q pod %q container %q. %v",
podStatus.Spec.NodeName, podStatus.Name, containerName, err)
@@ -4321,7 +4320,6 @@ func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeo
if err != nil {
return err
}
defer podClient.Delete(podName, nil)
err = WaitForPodSuccessInNamespace(f.Client, podName, f.Namespace.Name)
if err != nil {