Fix kubectl timeout test flake in e2e/portforward

Instead of using `kubectl logs -f` and waiting for it to terminate when the container/pod stopped,
switch to explicitly waiting for the pod to stop and then get the pod logs without -f to avoid
hanging.
This commit is contained in:
Andy Goldstein
2016-02-19 14:27:25 -05:00
parent 4d59d700c2
commit 03d926c2a7
3 changed files with 79 additions and 26 deletions

View File

@@ -248,6 +248,12 @@ func (f *Framework) WaitForPodRunningSlow(podName string) error {
return waitForPodRunningInNamespaceSlow(f.Client, podName, f.Namespace.Name)
}
// WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either
// success or failure.
func (f *Framework) WaitForPodNoLongerRunning(podName string) error {
return waitForPodNoLongerRunningInNamespace(f.Client, podName, f.Namespace.Name)
}
// Runs the given pod and verifies that the output of exact container matches the desired output.
func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string) {
testContainerOutput(scenarioName, f.Client, pod, containerIndex, expectedOutput, f.Namespace.Name)