From 406aef8a4b4a138fce3d2db5914a37d8d17ca78f Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Sun, 16 May 2021 18:00:04 -0400 Subject: [PATCH] LUCENE-9935: Fix testRandomStoredFieldsWithIndexSort Skip verifying if the list of live ids is empty --- .../apache/lucene/index/BaseStoredFieldsFormatTestCase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java index e2a10d768b39..a6af7a294210 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java @@ -899,6 +899,9 @@ public void testRandomStoredFieldsWithIndexSort() throws Exception { List addedIds = new ArrayList<>(); Runnable verifyStoreFields = () -> { + if (addedIds.isEmpty()) { + return; + } try (DirectoryReader reader = maybeWrapWithMergingReader(iw.getReader())) { IndexSearcher searcher = new IndexSearcher(reader); int iters = TestUtil.nextInt(random(), 1, 10);