Skip to content

Commit

Permalink
Fix the flaky test for derived fields highlighter test (#13313) (#13319)
Browse files Browse the repository at this point in the history
(cherry picked from commit bfbdc9f)

Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 5d7959b commit 2cd3a5c
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ public void testDerivedFieldFromIndexMapping() throws IOException {

// create a fetch context to be used by HighlightPhase processor
FetchContext fetchContext = mock(FetchContext.class);
when(fetchContext.mapperService()).thenReturn(mockShardContext.getMapperService());
when(fetchContext.mapperService()).thenReturn(mapperService);
when(fetchContext.getQueryShardContext()).thenReturn(mockShardContext);
when(fetchContext.getIndexSettings()).thenReturn(indexService.getIndexSettings());
when(fetchContext.searcher()).thenReturn(
new ContextIndexSearcher(
searcher.getIndexReader(),
searcher.getSimilarity(),
searcher.getQueryCache(),
searcher.getQueryCachingPolicy(),
reader,
IndexSearcher.getDefaultSimilarity(),
IndexSearcher.getDefaultQueryCache(),
IndexSearcher.getDefaultQueryCachingPolicy(),
true,
searcher.getExecutor(),
null,
null
)
);
Expand Down Expand Up @@ -253,17 +253,17 @@ public void testDerivedFieldFromSearchMapping() throws IOException {

// create a fetch context to be used by HighlightPhase processor
FetchContext fetchContext = mock(FetchContext.class);
when(fetchContext.mapperService()).thenReturn(mockShardContext.getMapperService());
when(fetchContext.mapperService()).thenReturn(mapperService);
when(fetchContext.getQueryShardContext()).thenReturn(mockShardContext);
when(fetchContext.getIndexSettings()).thenReturn(indexService.getIndexSettings());
when(fetchContext.searcher()).thenReturn(
new ContextIndexSearcher(
searcher.getIndexReader(),
searcher.getSimilarity(),
searcher.getQueryCache(),
searcher.getQueryCachingPolicy(),
reader,
IndexSearcher.getDefaultSimilarity(),
IndexSearcher.getDefaultQueryCache(),
IndexSearcher.getDefaultQueryCachingPolicy(),
true,
searcher.getExecutor(),
null,
null
)
);
Expand Down

0 comments on commit 2cd3a5c

Please sign in to comment.