Skip to content

Commit cab1296

Browse files
spinscalefinnroblin
authored andcommitted
TestRescoreTopNQuery: Don't flush per document (apache#15600)
Thank you. Next time - please do add changes entry and credit yourself!
1 parent 96b68b1 commit cab1296

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lucene/core/src/test/org/apache/lucene/search/TestRescoreTopNQuery.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.apache.lucene.tests.util.TestUtil;
4545
import org.junit.Assert;
4646
import org.junit.Before;
47-
import org.junit.Test;
4847

4948
public class TestRescoreTopNQuery extends LuceneTestCase {
5049

@@ -69,7 +68,6 @@ public void setUp() throws Exception {
6968
TestUtil.alwaysKnnVectorsFormat(new Lucene104HnswScalarQuantizedVectorsFormat()));
7069
}
7170

72-
@Test
7371
public void testInvalidN() {
7472
expectThrows(
7573
IllegalArgumentException.class,
@@ -79,7 +77,6 @@ public void testInvalidN() {
7977
}
8078

8179
// TODO: incredibly slow
82-
@Test
8380
@Nightly
8481
public void testRescoreField() throws Exception {
8582
Map<Integer, float[]> vectors = new HashMap<>();
@@ -100,9 +97,8 @@ public void testRescoreField() throws Exception {
10097
doc.add(new KnnFloatVectorField(FIELD, vector, VECTOR_SIMILARITY_FUNCTION));
10198
writer.addDocument(doc);
10299
vectors.put(id, vector);
103-
104-
writer.flush();
105100
}
101+
writer.flush();
106102
}
107103
}
108104

@@ -197,8 +193,8 @@ public void testLateInteractionQuery() throws Exception {
197193
doc.add(new IntField("has_li_vector", 1, Field.Store.YES));
198194
}
199195
w.addDocument(doc);
200-
w.flush();
201196
}
197+
w.flush();
202198
}
203199
// add a segment with no vectors
204200
for (int i = 0; i < 100; i++) {

0 commit comments

Comments
 (0)