Skip to content

Commit

Permalink
Fix DocValuesCodecDuelTests testDuel (elastic#112084)
Browse files Browse the repository at this point in the history
We need to check the returned doc id from advance() before accessing the
values of the current document.

Closes elastic#112082
  • Loading branch information
dnhatn authored Aug 22, 2024
1 parent fe786b7 commit 967af10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ tests:
- class: org.elasticsearch.xpack.esql.qa.single_node.RestEsqlIT
method: testForceSleepsProfile {ASYNC}
issue: https://github.com/elastic/elasticsearch/issues/112049
- class: org.elasticsearch.index.codec.tsdb.DocValuesCodecDuelTests
method: testDuel
issue: https://github.com/elastic/elasticsearch/issues/112082
- class: org.elasticsearch.xpack.inference.InferenceRestIT
method: test {p0=inference/80_random_rerank_retriever/Random rerank retriever predictably shuffles results}
issue: https://github.com/elastic/elasticsearch/issues/111999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ private void assertSortedDocValues(LeafReader baselineReader, LeafReader contend
for (int i = 0; i < docIdsToAdvanceTo.length; i++) {
int docId = docIdsToAdvanceTo[i];
int baselineTarget = assertAdvance(docId, baselineReader, contenderReader, baseline, contender);
if (baselineTarget == NO_MORE_DOCS) {
break;
}
assertEquals(baseline.ordValue(), contender.ordValue());
assertEquals(baseline.lookupOrd(baseline.ordValue()), contender.lookupOrd(contender.ordValue()));
i = shouldSkipDocIds(i, docId, baselineTarget, docIdsToAdvanceTo);
Expand Down

0 comments on commit 967af10

Please sign in to comment.