From f943a57ebebba893d5b00dacc7a971250a6f85dd Mon Sep 17 00:00:00 2001 From: Greg Miller Date: Fri, 22 Jul 2022 14:13:34 -0700 Subject: [PATCH] Fix another TestDisiPriorityQueue bug --- .../test/org/apache/lucene/search/TestDisiPriorityQueue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDisiPriorityQueue.java b/lucene/core/src/test/org/apache/lucene/search/TestDisiPriorityQueue.java index 0faafe7d5a2..03b4fab8ab9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestDisiPriorityQueue.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestDisiPriorityQueue.java @@ -43,7 +43,7 @@ public class TestDisiPriorityQueue extends LuceneTestCase { pq.add(w); } } else { - if (r.nextInt(10) < 2) { + if (r.nextInt(10) < 2 && size > 1) { int len = random().nextInt(1, size); for (int i = 0; i < len; i++) { pq.add(all[i]);