mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 01:26:28 +00:00
fix data races in scheduler unit tests
This commit is contained in:
parent
ddd6d668f6
commit
7e33feec57
@ -385,6 +385,8 @@ func TestPriorityQueue_MoveAllToActiveOrBackoffQueue(t *testing.T) {
|
|||||||
q.AddUnschedulableIfNotPresent(q.newPodInfo(&unschedulablePod), q.SchedulingCycle())
|
q.AddUnschedulableIfNotPresent(q.newPodInfo(&unschedulablePod), q.SchedulingCycle())
|
||||||
q.AddUnschedulableIfNotPresent(q.newPodInfo(&highPriorityPod), q.SchedulingCycle())
|
q.AddUnschedulableIfNotPresent(q.newPodInfo(&highPriorityPod), q.SchedulingCycle())
|
||||||
q.MoveAllToActiveOrBackoffQueue("test")
|
q.MoveAllToActiveOrBackoffQueue("test")
|
||||||
|
q.lock.Lock()
|
||||||
|
defer q.lock.Unlock()
|
||||||
if q.activeQ.Len() != 1 {
|
if q.activeQ.Len() != 1 {
|
||||||
t.Error("Expected 1 item to be in activeQ")
|
t.Error("Expected 1 item to be in activeQ")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user