kube-scheduler: convert the remaining part to use contextual logging
This commit is contained in:
@@ -1145,10 +1145,11 @@ func NextPodOrDie(t *testing.T, testCtx *TestContext) *schedulerframework.Queued
|
||||
t.Helper()
|
||||
|
||||
var podInfo *schedulerframework.QueuedPodInfo
|
||||
logger := klog.FromContext(testCtx.Ctx)
|
||||
// NextPod() is a blocking operation. Wrap it in timeout() to avoid relying on
|
||||
// default go testing timeout (10m) to abort.
|
||||
if err := timeout(testCtx.Ctx, time.Second*5, func() {
|
||||
podInfo, _ = testCtx.Scheduler.NextPod()
|
||||
podInfo, _ = testCtx.Scheduler.NextPod(logger)
|
||||
}); err != nil {
|
||||
t.Fatalf("Timed out waiting for the Pod to be popped: %v", err)
|
||||
}
|
||||
@@ -1160,10 +1161,11 @@ func NextPod(t *testing.T, testCtx *TestContext) *schedulerframework.QueuedPodIn
|
||||
t.Helper()
|
||||
|
||||
var podInfo *schedulerframework.QueuedPodInfo
|
||||
logger := klog.FromContext(testCtx.Ctx)
|
||||
// NextPod() is a blocking operation. Wrap it in timeout() to avoid relying on
|
||||
// default go testing timeout (10m) to abort.
|
||||
if err := timeout(testCtx.Ctx, time.Second*5, func() {
|
||||
podInfo, _ = testCtx.Scheduler.NextPod()
|
||||
podInfo, _ = testCtx.Scheduler.NextPod(logger)
|
||||
}); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user