From dd4fb3cd37d3f122a8d5cf2d9c9dcc1545d17ed3 Mon Sep 17 00:00:00 2001 From: kerthcet Date: Thu, 25 Aug 2022 13:29:09 +0800 Subject: [PATCH] fix test error Signed-off-by: kerthcet --- test/integration/scheduler/plugins/plugins_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/scheduler/plugins/plugins_test.go b/test/integration/scheduler/plugins/plugins_test.go index 44b191b4802..2e881595c72 100644 --- a/test/integration/scheduler/plugins/plugins_test.go +++ b/test/integration/scheduler/plugins/plugins_test.go @@ -581,10 +581,14 @@ func TestPreFilterPlugin(t *testing.T) { t.Errorf("Error while creating a test pod: %v", err) } - if test.reject || test.fail { + if test.reject { if err = waitForPodUnschedulable(testCtx.ClientSet, pod); err != nil { t.Errorf("Didn't expect the pod to be scheduled. error: %v", err) } + } else if test.fail { + if err = wait.Poll(10*time.Millisecond, 30*time.Second, podSchedulingError(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil { + t.Errorf("Expected a scheduling error, but got: %v", err) + } } else { if err = testutils.WaitForPodToSchedule(testCtx.ClientSet, pod); err != nil { t.Errorf("Expected the pod to be scheduled. error: %v", err)