dweiss opened a new issue, #12883:
URL: https://github.com/apache/lucene/issues/12883

   ### Description
   
   I came across this one by stress-testing the package with -Dtests.iters=200. 
Occasional hiccups in unified highlighter tests, for example:
   ```
   gradlew :lucene:highlighter:test --tests 
"org.apache.lucene.search.uhighlight.TestUnifiedHighlighter.testOneSentence" 
-Ptests.seed=24C86DF477CBF09B:8FFE031B3019BA09
   ```
   The test expects documents in indexing order:
   ```
       body.setStringValue("This is a test.");
       iw.addDocument(doc);
       body.setStringValue("Test a one sentence document.");
       iw.addDocument(doc);
   
       IndexReader ir = iw.getReader();
       iw.close();
   
       IndexSearcher searcher = newSearcher(ir);
       UnifiedHighlighter highlighter = randomUnifiedHighlighter(searcher, 
indexAnalyzer);
       Query query = new TermQuery(new Term("body", "test"));
       TopDocs topDocs = searcher.search(query, 10, Sort.INDEXORDER);
       assertEquals(2, topDocs.totalHits.value);
       String[] snippets = highlighter.highlight("body", query, topDocs);
       assertEquals(2, snippets.length);
       assertEquals("This is a <b>test</b>.", snippets[0]);
       assertEquals("<b>Test</b> a one sentence document.", snippets[1]);
   ```
   But for some reason they're swapped. 
   
   I didn't look into it but it also happens with other tests (rarely).
   
   ### Version and environment details
   
   _No response_


-- 
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.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

Reply via email to