mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-08-08 23:37:11 +00:00
Merge pull request #136264 from michaelasp/unlockWhileProcess
Ensure that processing does not block queue writers in RealFIFO
This commit is contained in:
@@ -4660,7 +4660,7 @@ func setupTestScheduler(ctx context.Context, t *testing.T, client clientset.Inte
|
||||
nodeInfoSnapshot: snapshot,
|
||||
percentageOfNodesToScore: schedulerapi.DefaultPercentageOfNodesToScore,
|
||||
NextPod: func(logger klog.Logger) (*framework.QueuedPodInfo, error) {
|
||||
return &framework.QueuedPodInfo{PodInfo: mustNewPodInfo(t, clientcache.Pop(queuedPodStore).(*v1.Pod))}, nil
|
||||
return &framework.QueuedPodInfo{PodInfo: mustNewPodInfo(t, pop(queuedPodStore).(*v1.Pod))}, nil
|
||||
},
|
||||
SchedulingQueue: schedulingQueue,
|
||||
APIDispatcher: apiDispatcher,
|
||||
@@ -4743,3 +4743,13 @@ func mustNewPodInfo(t *testing.T, pod *v1.Pod) *framework.PodInfo {
|
||||
}
|
||||
return podInfo
|
||||
}
|
||||
|
||||
func pop(queue clientcache.Queue) interface{} {
|
||||
obj, err := queue.Pop(func(obj interface{}, isInInitialList bool) error {
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user