ChrisHegarty commented on code in PR #12903: URL: https://github.com/apache/lucene/pull/12903#discussion_r1421825869
########## lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java: ########## @@ -150,4 +154,18 @@ public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { } dir.deleteFile("tmp"); } + + // This simple test tickles a JVM JIT crash on JDK's less than 21.0.1 + // Needs to be run with C2, so with the environment variable `CI` set + public void testCrash() throws IOException { + for (int i = 0; i < 100; i++) { + try (Directory dir = newDirectory(); + IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) { + for (int d = 0; d < 20_000; d++) { + iw.addDocument( + List.of(new IntPoint("foo", 0), new SortedNumericDocValuesField("bar", 0))); + } + } + } + } Review Comment: The test takes around 3.5 seconds on my laptop. I can probably reduce the iterations. Or make the number of iterations depend on whether nightly or not? I’ll take a look. ########## lucene/core/src/test/org/apache/lucene/util/bkd/TestDocIdsWriter.java: ########## @@ -150,4 +154,18 @@ public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { } dir.deleteFile("tmp"); } + + // This simple test tickles a JVM JIT crash on JDK's less than 21.0.1 + // Needs to be run with C2, so with the environment variable `CI` set + public void testCrash() throws IOException { + for (int i = 0; i < 100; i++) { + try (Directory dir = newDirectory(); + IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) { + for (int d = 0; d < 20_000; d++) { + iw.addDocument( + List.of(new IntPoint("foo", 0), new SortedNumericDocValuesField("bar", 0))); + } + } + } + } Review Comment: The test takes around 3.5 seconds on my laptop. I can probably reduce the iterations. Or make the number of iterations depend on whether nightly or not? I’ll take a look. -- 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