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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]