mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
check activeQ len before pop
This commit is contained in:
parent
131d145b7d
commit
ca50e459b0
@ -1521,7 +1521,12 @@ func TestPodTimestamp(t *testing.T) {
|
|||||||
op(queue, test.operands[i])
|
op(queue, test.operands[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(test.expected); i++ {
|
expectedLen := len(test.expected)
|
||||||
|
if queue.activeQ.Len() != expectedLen {
|
||||||
|
t.Fatalf("Expected %v items to be in activeQ, but got: %v", expectedLen, queue.activeQ.Len())
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < expectedLen; i++ {
|
||||||
if pInfo, err := queue.activeQ.Pop(); err != nil {
|
if pInfo, err := queue.activeQ.Pop(); err != nil {
|
||||||
t.Errorf("Error while popping the head of the queue: %v", err)
|
t.Errorf("Error while popping the head of the queue: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user