jtibshirani commented on code in PR #11867: URL: https://github.com/apache/lucene/pull/11867#discussion_r1001200789
########## lucene/core/src/test/org/apache/lucene/document/TestManyKnnVectors.java: ########## @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.document; + +import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.VectorSimilarityFunction; +import org.apache.lucene.index.VectorValues; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.SortField; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.FSDirectory; +import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.LuceneTestCase.Monster; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.channels.FileChannel; +import java.nio.file.Path; +import java.nio.file.Paths; + +import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; + + +/** + * Tests a large dataset of kNN vectors to check for issues that only show up when + * segments are very large, like overflow. The dataset is based on the StackOverflow + * track from Elasticsearch's rally benchmarks: https://github.com/elastic/rally-tracks/tree/master/so_vector. + * + * Steps to run the test + * 1. Download the dataset: wget https://rally-tracks.elastic.co/so_vector/documents.bin + * 2. Move the dataset to the resources folder: mv documents.bin lucene/core/src/resources/ + * 3. Start the test: + * ./gradlew test --tests TestManyKnnVectors.testLargeSegment -Dtests.monster=true -Dtests.verbose=true \ + * -Dorg.gradle.jvmargs="-Xms2g -Xmx2g" --max-workers=1 + */ +@TimeoutSuite(millis = 10_800_000) // 3 hour timeout +@Monster("takes ~2 hours and needs 2GB heap") +public class TestManyKnnVectors extends LuceneTestCase { + public void testLargeSegment() throws Exception { + IndexWriterConfig iwc = newIndexWriterConfig(); Review Comment: These are good points, I'll push the suggested changes. I guess my computer is beefier, I completed runs in under 2 hours each and confirmed it fails before the change, succeeds after. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org