fix test error

Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
kerthcet 2022-08-25 13:29:09 +08:00
parent eeb6e791d9
commit dd4fb3cd37

View File

@ -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)