1616import org .elasticsearch .search .SearchService ;
1717
1818import java .util .Arrays ;
19- import java .util .concurrent .TimeUnit ;
2019
2120import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
2221import static org .hamcrest .Matchers .contains ;
@@ -28,24 +27,22 @@ public class SqlSearchPageTimeoutIT extends AbstractSqlIntegTestCase {
2827 protected Settings nodeSettings (int nodeOrdinal , Settings otherSettings ) {
2928 Settings .Builder settings = Settings .builder ().put (super .nodeSettings (nodeOrdinal , otherSettings ));
3029 // use static low keepAlive interval to ensure obsolete search contexts are pruned soon enough
31- settings .put (SearchService .KEEPALIVE_INTERVAL_SETTING .getKey (), TimeValue .timeValueMillis (200 ));
30+ settings .put (SearchService .KEEPALIVE_INTERVAL_SETTING .getKey (), TimeValue .timeValueMillis (100 ));
3231 return settings .build ();
3332 }
3433
35- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/pull/79928" )
3634 public void testSearchContextIsCleanedUpAfterPageTimeoutForHitsQueries () throws Exception {
3735 setupTestIndex ();
3836
3937 SqlQueryResponse response = new SqlQueryRequestBuilder (client (), SqlQueryAction .INSTANCE ).query ("SELECT field FROM test" )
4038 .fetchSize (1 )
41- .pageTimeout (TimeValue .timeValueMillis (100 ))
39+ .pageTimeout (TimeValue .timeValueMillis (500 ))
4240 .get ();
4341
44- assertEquals (1 , response .size ());
4542 assertTrue (response .hasCursor ());
4643 assertEquals (1 , getNumberOfSearchContexts ());
4744
48- assertBusy (() -> assertEquals (0 , getNumberOfSearchContexts ()), 3 , TimeUnit . SECONDS );
45+ assertBusy (() -> assertEquals (0 , getNumberOfSearchContexts ()));
4946
5047 SearchPhaseExecutionException exception = expectThrows (
5148 SearchPhaseExecutionException .class ,
@@ -60,7 +57,7 @@ public void testNoSearchContextForAggregationQueries() throws InterruptedExcepti
6057
6158 SqlQueryResponse response = new SqlQueryRequestBuilder (client (), SqlQueryAction .INSTANCE ).query (
6259 "SELECT COUNT(*) FROM test GROUP BY field"
63- ).fetchSize (1 ).pageTimeout (TimeValue .timeValueMillis (100 )).get ();
60+ ).fetchSize (1 ).pageTimeout (TimeValue .timeValueMillis (500 )).get ();
6461
6562 assertEquals (1 , response .size ());
6663 assertTrue (response .hasCursor ());
0 commit comments