Unverified Commit a99fdfc6 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #56480 from CaoShuFeng/schedule_queue

Automatic merge from submit-queue (batch tested with PRs 56480, 56675, 56624, 56648, 56658). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix scheduling queue unit test This change makes sure the Pop() test finish completely. **Release note**: ```release-note NONE ```
parents 27125401 33f6625a
......@@ -18,6 +18,7 @@ package core
import (
"reflect"
"sync"
"testing"
"k8s.io/api/core/v1"
......@@ -87,12 +88,16 @@ func TestPriorityQueue_Add(t *testing.T) {
func TestPriorityQueue_Pop(t *testing.T) {
q := NewPriorityQueue()
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
if p, err := q.Pop(); err != nil || p != &highPriorityPod {
t.Errorf("Expected: %v after Pop, but got: %v", highPriorityPod.Name, p.Name)
}
}()
q.Add(&highPriorityPod)
wg.Wait()
}
func TestPriorityQueue_Update(t *testing.T) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment