Direct reference to the packages

Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
kerthcet
2023-07-08 12:03:46 +08:00
parent 0e14098333
commit 47ef977ddd
5 changed files with 138 additions and 164 deletions

View File

@@ -145,7 +145,7 @@ func TestSchedulingGates(t *testing.T) {
// Pop the expected pods out. They should be de-queueable.
for _, wantPod := range tt.want {
podInfo := nextPodOrDie(t, testCtx)
podInfo := testutils.NextPodOrDie(t, testCtx)
if got := podInfo.Pod.Name; got != wantPod {
t.Errorf("Want %v to be popped out, but got %v", wantPod, got)
}
@@ -164,7 +164,7 @@ func TestSchedulingGates(t *testing.T) {
}
// Pop the expected pods out. They should be de-queueable.
for _, wantPod := range tt.wantPostGatesRemoval {
podInfo := nextPodOrDie(t, testCtx)
podInfo := testutils.NextPodOrDie(t, testCtx)
if got := podInfo.Pod.Name; got != wantPod {
t.Errorf("Want %v to be popped out, but got %v", wantPod, got)
}
@@ -222,7 +222,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
// Pop the three pods out. They should be unschedulable.
for i := 0; i < 3; i++ {
podInfo := nextPodOrDie(t, testCtx)
podInfo := testutils.NextPodOrDie(t, testCtx)
fwk, ok := testCtx.Scheduler.Profiles[podInfo.Pod.Spec.SchedulerName]
if !ok {
t.Fatalf("Cannot find the profile for Pod %v", podInfo.Pod.Name)
@@ -243,7 +243,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
}
// Now we should be able to pop the Pod from activeQ again.
podInfo := nextPodOrDie(t, testCtx)
podInfo := testutils.NextPodOrDie(t, testCtx)
if podInfo.Attempts != 2 {
t.Fatalf("Expected the Pod to be attempted 2 times, but got %v", podInfo.Attempts)
}
@@ -255,7 +255,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
// - Although the failure reason has been lifted, Pod2 still won't be moved to active due to
// the node event's preCheckForNode().
// - Regarding Pod3, the NodeTaintChange event is irrelevant with its scheduling failure.
podInfo = nextPod(t, testCtx)
podInfo = testutils.NextPod(t, testCtx)
if podInfo != nil {
t.Fatalf("Unexpected pod %v get popped out", podInfo.Pod.Name)
}
@@ -402,7 +402,7 @@ func TestCustomResourceEnqueue(t *testing.T) {
}
// Pop fake-pod out. It should be unschedulable.
podInfo := nextPodOrDie(t, testCtx)
podInfo := testutils.NextPodOrDie(t, testCtx)
fwk, ok := testCtx.Scheduler.Profiles[podInfo.Pod.Spec.SchedulerName]
if !ok {
t.Fatalf("Cannot find the profile for Pod %v", podInfo.Pod.Name)
@@ -434,7 +434,7 @@ func TestCustomResourceEnqueue(t *testing.T) {
}
// Now we should be able to pop the Pod from activeQ again.
podInfo = nextPodOrDie(t, testCtx)
podInfo = testutils.NextPodOrDie(t, testCtx)
if podInfo.Attempts != 2 {
t.Errorf("Expected the Pod to be attempted 2 times, but got %v", podInfo.Attempts)
}