Skip to content

Commit

Permalink
Change EngineTestCase to not wrap the reader. (elastic#98732)
Browse files Browse the repository at this point in the history
As part elastic#98110, EngineTestCase now uses newSearcher() to create a new
index searcher (instead of just creating a new index searcher). This is
for increasing test coverage. However, this test can't deal with
wrapping the index reader as it leads to assertion errors. So instead
use `newSearcher(leaf, false)` to still keep to test benefits of
wrapping the index searcher.

Closes elastic#98716
  • Loading branch information
martijnvg authored Aug 23, 2023
1 parent 0a2fbee commit b2ae984
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ public MatchingDirectoryReader(DirectoryReader in, Query query) throws IOExcepti
@Override
public LeafReader wrap(LeafReader leaf) {
try {
final IndexSearcher searcher = newSearcher(leaf);
final IndexSearcher searcher = newSearcher(leaf, false);
searcher.setQueryCache(null);
final Weight weight = searcher.createWeight(query, ScoreMode.COMPLETE_NO_SCORES, 1.0f);
final Scorer scorer = weight.scorer(leaf.getContext());
Expand Down

0 comments on commit b2ae984

Please sign in to comment.