16
16
import org .elasticsearch .search .SearchService ;
17
17
18
18
import java .util .Arrays ;
19
- import java .util .concurrent .TimeUnit ;
20
19
21
20
import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
22
21
import static org .hamcrest .Matchers .contains ;
@@ -28,24 +27,22 @@ public class SqlSearchPageTimeoutIT extends AbstractSqlIntegTestCase {
28
27
protected Settings nodeSettings (int nodeOrdinal , Settings otherSettings ) {
29
28
Settings .Builder settings = Settings .builder ().put (super .nodeSettings (nodeOrdinal , otherSettings ));
30
29
// 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 ));
32
31
return settings .build ();
33
32
}
34
33
35
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/pull/79928" )
36
34
public void testSearchContextIsCleanedUpAfterPageTimeoutForHitsQueries () throws Exception {
37
35
setupTestIndex ();
38
36
39
37
SqlQueryResponse response = new SqlQueryRequestBuilder (client (), SqlQueryAction .INSTANCE ).query ("SELECT field FROM test" )
40
38
.fetchSize (1 )
41
- .pageTimeout (TimeValue .timeValueMillis (100 ))
39
+ .pageTimeout (TimeValue .timeValueMillis (500 ))
42
40
.get ();
43
41
44
- assertEquals (1 , response .size ());
45
42
assertTrue (response .hasCursor ());
46
43
assertEquals (1 , getNumberOfSearchContexts ());
47
44
48
- assertBusy (() -> assertEquals (0 , getNumberOfSearchContexts ()), 3 , TimeUnit . SECONDS );
45
+ assertBusy (() -> assertEquals (0 , getNumberOfSearchContexts ()));
49
46
50
47
SearchPhaseExecutionException exception = expectThrows (
51
48
SearchPhaseExecutionException .class ,
@@ -60,7 +57,7 @@ public void testNoSearchContextForAggregationQueries() throws InterruptedExcepti
60
57
61
58
SqlQueryResponse response = new SqlQueryRequestBuilder (client (), SqlQueryAction .INSTANCE ).query (
62
59
"SELECT COUNT(*) FROM test GROUP BY field"
63
- ).fetchSize (1 ).pageTimeout (TimeValue .timeValueMillis (100 )).get ();
60
+ ).fetchSize (1 ).pageTimeout (TimeValue .timeValueMillis (500 )).get ();
64
61
65
62
assertEquals (1 , response .size ());
66
63
assertTrue (response .hasCursor ());
0 commit comments