From d4460c0cc11440dcfe3c52a47c8a6130b1d65932 Mon Sep 17 00:00:00 2001 From: Luegg Date: Wed, 27 Oct 2021 18:13:40 +0200 Subject: [PATCH 1/3] SQL: stabilize SqlSearchPageTimeoutIT --- .../xpack/sql/action/SqlSearchPageTimeoutIT.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java index ec7da860f1d8f..acf7fa19f2d7a 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java @@ -16,7 +16,6 @@ import org.elasticsearch.search.SearchService; import java.util.Arrays; -import java.util.concurrent.TimeUnit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.contains; @@ -28,7 +27,7 @@ public class SqlSearchPageTimeoutIT extends AbstractSqlIntegTestCase { protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)); // use static low keepAlive interval to ensure obsolete search contexts are pruned soon enough - settings.put(SearchService.KEEPALIVE_INTERVAL_SETTING.getKey(), TimeValue.timeValueMillis(200)); + settings.put(SearchService.KEEPALIVE_INTERVAL_SETTING.getKey(), TimeValue.timeValueMillis(100)); return settings.build(); } @@ -37,14 +36,14 @@ public void testSearchContextIsCleanedUpAfterPageTimeoutForHitsQueries() throws SqlQueryResponse response = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query("SELECT field FROM test") .fetchSize(1) - .pageTimeout(TimeValue.timeValueMillis(100)) + .pageTimeout(TimeValue.timeValueMillis(500)) .get(); assertEquals(1, response.size()); assertTrue(response.hasCursor()); assertEquals(1, getNumberOfSearchContexts()); - assertBusy(() -> assertEquals(0, getNumberOfSearchContexts()), 3, TimeUnit.SECONDS); + assertBusy(() -> assertEquals(0, getNumberOfSearchContexts())); SearchPhaseExecutionException exception = expectThrows( SearchPhaseExecutionException.class, @@ -59,7 +58,7 @@ public void testNoSearchContextForAggregationQueries() throws InterruptedExcepti SqlQueryResponse response = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query( "SELECT COUNT(*) FROM test GROUP BY field" - ).fetchSize(1).pageTimeout(TimeValue.timeValueMillis(100)).get(); + ).fetchSize(1).pageTimeout(TimeValue.timeValueMillis(500)).get(); assertEquals(1, response.size()); assertTrue(response.hasCursor()); From 87c50b373a019adb37acee62aa76914fb12b9152 Mon Sep 17 00:00:00 2001 From: Luegg Date: Wed, 27 Oct 2021 18:25:46 +0200 Subject: [PATCH 2/3] make it even more stable --- .../elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java index acf7fa19f2d7a..479c9042e2d95 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java @@ -39,7 +39,6 @@ public void testSearchContextIsCleanedUpAfterPageTimeoutForHitsQueries() throws .pageTimeout(TimeValue.timeValueMillis(500)) .get(); - assertEquals(1, response.size()); assertTrue(response.hasCursor()); assertEquals(1, getNumberOfSearchContexts()); From 1c90729fb7a588d4ef05ba2546cc8b0542ccc9f0 Mon Sep 17 00:00:00 2001 From: Luegg Date: Thu, 28 Oct 2021 09:02:30 +0200 Subject: [PATCH 3/3] unmute test --- .../elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java index a8dea108d5c6f..479c9042e2d95 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlSearchPageTimeoutIT.java @@ -31,7 +31,6 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { return settings.build(); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/79928") public void testSearchContextIsCleanedUpAfterPageTimeoutForHitsQueries() throws Exception { setupTestIndex();