test: Bump timeout for runPausePod

The `runPausePod` timeout was 1 minute previously which appears to be
too short and timing out in some tests.

Switch to `f.Timeouts.PodStartShort` which is the common timeout used to wait
for pods to start which defaults to 5min.

Also refactor to remove `runPausePodWithoutTimeout` and instead rely on
`runPausePod` since we do not make the timeout customizable directly
(it can be changed via the test framework if desired).

Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
David Porter
2023-01-30 14:08:42 -08:00
parent 0cb1eabbf0
commit 71719a6036
2 changed files with 5 additions and 9 deletions

View File

@@ -952,12 +952,8 @@ func createPausePod(ctx context.Context, f *framework.Framework, conf pausePodCo
}
func runPausePod(ctx context.Context, f *framework.Framework, conf pausePodConfig) *v1.Pod {
return runPausePodWithTimeout(ctx, f, conf, framework.PollShortTimeout)
}
func runPausePodWithTimeout(ctx context.Context, f *framework.Framework, conf pausePodConfig, timeout time.Duration) *v1.Pod {
pod := createPausePod(ctx, f, conf)
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace, timeout))
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace, f.Timeouts.PodStartShort))
pod, err := f.ClientSet.CoreV1().Pods(pod.Namespace).Get(ctx, conf.Name, metav1.GetOptions{})
framework.ExpectNoError(err)
return pod