Skip to content

Commit 0da5e10

Browse files
committed
iter
1 parent 6db9028 commit 0da5e10

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/test/java/org/elasticsearch/search/query/QueryPhaseTimeoutTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public void tearDown() throws Exception {
116116
}
117117

118118
private static ContextIndexSearcher newContextSearcher(IndexReader reader) throws IOException {
119+
//note that no executor is provided, as this test requires sequential execution
119120
return new ContextIndexSearcher(
120121
reader,
121122
IndexSearcher.getDefaultSimilarity(),
@@ -187,6 +188,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
187188

188189
@Override
189190
public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {
191+
//trigger the timeout as soon as the scorer supplier is request for the second segment
190192
if (firstSegment == false && isTimeoutExpected) {
191193
shouldTimeout = true;
192194
}
@@ -266,6 +268,7 @@ public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOExcepti
266268
return new ScorerSupplier() {
267269
@Override
268270
public Scorer get(long leadCost) throws IOException {
271+
//trigger the timeout as soon as the scorer is requested for the second segment
269272
if (firstSegment == false && isTimeoutExpected) {
270273
shouldTimeout = true;
271274
}

0 commit comments

Comments
 (0)