mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-03 04:06:14 +00:00
using wait.PollUntilContextTimeout instead of deprecated wait.Poll for pkg/scheduler
using wait.PollUntilContextTimeout instead of deprecated wait.Poll for test/integration/scheduler using wait.PollUntilContextTimeout instead of deprecated wait.Poll for test/e2e/scheduling using wait.ConditionWithContextFunc for PodScheduled/PodIsGettingEvicted/PodScheduledIn/PodUnschedulable/PodSchedulingError
This commit is contained in:
@@ -218,7 +218,8 @@ func TestReScheduling(t *testing.T) {
|
||||
|
||||
// The first time for scheduling, pod is error or unschedulable, controlled by wantFirstSchedulingError
|
||||
if test.wantFirstSchedulingError {
|
||||
if err = wait.Poll(10*time.Millisecond, 30*time.Second, testutils.PodSchedulingError(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil {
|
||||
if err = wait.PollUntilContextTimeout(testCtx.Ctx, 10*time.Millisecond, 30*time.Second, false,
|
||||
testutils.PodSchedulingError(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil {
|
||||
t.Errorf("Expected a scheduling error, but got: %v", err)
|
||||
}
|
||||
} else {
|
||||
@@ -238,7 +239,8 @@ func TestReScheduling(t *testing.T) {
|
||||
t.Errorf("Didn't expect the pod to be unschedulable. error: %v", err)
|
||||
}
|
||||
} else if test.wantError {
|
||||
if err = wait.Poll(10*time.Millisecond, 30*time.Second, testutils.PodSchedulingError(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil {
|
||||
if err = wait.PollUntilContextTimeout(testCtx.Ctx, 10*time.Millisecond, 30*time.Second, false,
|
||||
testutils.PodSchedulingError(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil {
|
||||
t.Errorf("Expected a scheduling error, but got: %v", err)
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user