mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Increase preemption timeout from 1 minute to 2 minutes
This commit is contained in:
parent
61dc69ac2c
commit
8cf3347d87
@ -928,8 +928,12 @@ func createPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runPausePod(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)
|
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{})
|
pod, err := f.ClientSet.CoreV1().Pods(pod.Namespace).Get(context.TODO(), conf.Name, metav1.GetOptions{})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
return pod
|
return pod
|
||||||
|
@ -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")
|
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.
|
// 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",
|
Name: "preemptor-pod",
|
||||||
PriorityClassName: highPriorityClassName,
|
PriorityClassName: highPriorityClassName,
|
||||||
Resources: &v1.ResourceRequirements{
|
Resources: &v1.ResourceRequirements{
|
||||||
Requests: podRes,
|
Requests: podRes,
|
||||||
Limits: podRes,
|
Limits: podRes,
|
||||||
},
|
},
|
||||||
})
|
}, framework.PodStartShortTimeout)
|
||||||
|
|
||||||
preemptedPod, err := cs.CoreV1().Pods(pods[0].Namespace).Get(context.TODO(), pods[0].Name, metav1.GetOptions{})
|
preemptedPod, err := cs.CoreV1().Pods(pods[0].Namespace).Get(context.TODO(), pods[0].Name, metav1.GetOptions{})
|
||||||
podPreempted := (err != nil && apierrors.IsNotFound(err)) ||
|
podPreempted := (err != nil && apierrors.IsNotFound(err)) ||
|
||||||
@ -271,7 +271,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
|
|||||||
framework.Failf("Error cleanup pod `%s/%s`: %v", metav1.NamespaceSystem, "critical-pod", err)
|
framework.Failf("Error cleanup pod `%s/%s`: %v", metav1.NamespaceSystem, "critical-pod", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
runPausePod(f, pausePodConfig{
|
runPausePodWithTimeout(f, pausePodConfig{
|
||||||
Name: "critical-pod",
|
Name: "critical-pod",
|
||||||
Namespace: metav1.NamespaceSystem,
|
Namespace: metav1.NamespaceSystem,
|
||||||
PriorityClassName: scheduling.SystemClusterCritical,
|
PriorityClassName: scheduling.SystemClusterCritical,
|
||||||
@ -279,7 +279,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
|
|||||||
Requests: podRes,
|
Requests: podRes,
|
||||||
Limits: podRes,
|
Limits: podRes,
|
||||||
},
|
},
|
||||||
})
|
}, framework.PodStartShortTimeout)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// Clean-up the critical pod
|
// Clean-up the critical pod
|
||||||
|
Loading…
Reference in New Issue
Block a user