Skip to content

Commit

Permalink
UPSTREAM: 96990: Increase preemption timeout from 1 minute to 2 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
Huang-Wei authored and soltysh committed Sep 8, 2021
1 parent 58821ce commit 339c9c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion test/e2e/scheduling/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,12 @@ func createPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
}

func runPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
return runPausePodWithTimeout(f, conf, framework.PollShortTimeout)
}

func runPausePodWithTimeout(f *framework.Framework, conf pausePodConfig, timeout time.Duration) *v1.Pod {
pod := createPausePod(f, conf)
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(f.ClientSet, pod.Name, pod.Namespace, framework.PollShortTimeout))
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(f.ClientSet, pod.Name, pod.Namespace, timeout))
pod, err := f.ClientSet.CoreV1().Pods(pod.Namespace).Get(context.TODO(), conf.Name, metav1.GetOptions{})
framework.ExpectNoError(err)
return pod
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/scheduling/preemption.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {

ginkgo.By("Run a high priority pod that has same requirements as that of lower priority pod")
// Create a high priority pod and make sure it is scheduled on the same node as the low priority pod.
runPausePod(f, pausePodConfig{
runPausePodWithTimeout(f, pausePodConfig{
Name: "preemptor-pod",
PriorityClassName: highPriorityClassName,
Resources: &v1.ResourceRequirements{
Requests: podRes,
Limits: podRes,
},
})
}, framework.PodStartShortTimeout)

preemptedPod, err := cs.CoreV1().Pods(pods[0].Namespace).Get(context.TODO(), pods[0].Name, metav1.GetOptions{})
podPreempted := (err != nil && apierrors.IsNotFound(err)) ||
Expand Down Expand Up @@ -271,15 +271,15 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
framework.Failf("Error cleanup pod `%s/%s`: %v", metav1.NamespaceSystem, "critical-pod", err)
}
}()
runPausePod(f, pausePodConfig{
runPausePodWithTimeout(f, pausePodConfig{
Name: "critical-pod",
Namespace: metav1.NamespaceSystem,
PriorityClassName: scheduling.SystemClusterCritical,
Resources: &v1.ResourceRequirements{
Requests: podRes,
Limits: podRes,
},
})
}, framework.PodStartShortTimeout)

defer func() {
// Clean-up the critical pod
Expand Down

0 comments on commit 339c9c7

Please sign in to comment.