Expose a pending pods summary in scheudler's dummper output

This commit is contained in:
Wei Huang
2022-08-05 18:30:09 -07:00
parent 64ed914545
commit 7df9bfcfef
7 changed files with 30 additions and 17 deletions

View File

@@ -1713,9 +1713,9 @@ func TestUnschedulablePodBecomesSchedulable(t *testing.T) {
t.Errorf("Pod %v was not scheduled: %v", pod.Name, err)
}
// Make sure pending queue is empty.
pendingPods := len(testCtx.Scheduler.SchedulingQueue.PendingPods())
if pendingPods != 0 {
t.Errorf("pending pods queue is not empty, size is: %d", pendingPods)
pendingPods, s := testCtx.Scheduler.SchedulingQueue.PendingPods()
if len(pendingPods) != 0 {
t.Errorf("pending pods queue is not empty, size is: %d, summary is: %s", len(pendingPods), s)
}
})
}

View File

@@ -88,7 +88,8 @@ func TestCoreResourceEnqueue(t *testing.T) {
// Wait for the three pods to be present in the scheduling queue.
if err := wait.Poll(time.Millisecond*200, wait.ForeverTestTimeout, func() (bool, error) {
return len(testCtx.Scheduler.SchedulingQueue.PendingPods()) == 3, nil
pendingPods, _ := testCtx.Scheduler.SchedulingQueue.PendingPods()
return len(pendingPods) == 3, nil
}); err != nil {
t.Fatal(err)
}
@@ -263,7 +264,8 @@ func TestCustomResourceEnqueue(t *testing.T) {
// Wait for the testing Pod to be present in the scheduling queue.
if err := wait.Poll(time.Millisecond*200, wait.ForeverTestTimeout, func() (bool, error) {
return len(testCtx.Scheduler.SchedulingQueue.PendingPods()) == 1, nil
pendingPods, _ := testCtx.Scheduler.SchedulingQueue.PendingPods()
return len(pendingPods) == 1, nil
}); err != nil {
t.Fatal(err)
}