From b6989112317a86af5525704fad83788b47c10360 Mon Sep 17 00:00:00 2001 From: gmarouli Date: Thu, 26 Feb 2026 16:49:25 +0200 Subject: [PATCH 1/4] Add information about the API call to the warnings check assertion. --- .../test/rest/yaml/section/DoSection.java | 17 ++++++++++++++--- .../EsqlClientYamlAsyncSubmitAndFetchIT.java | 8 ++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index 8622684f10e41..07961a473cece 100644 --- a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -365,12 +365,20 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx : null; checkElasticProductHeader(response.getHeaders("X-elastic-product")); - checkWarningHeaders(response.getWarningHeaders(), testPath); + checkWarningHeaders(response.getWarningHeaders(), testPath, apiCallSection); } catch (ClientYamlTestResponseException e) { checkResponseException(e, executionContext); } } + private String getApiCallDescription(ApiCallSection apiCallSection) { + return apiCallSection.getApi() + + "[" + + (apiCallSection.getMethod() != null ? apiCallSection.getMethod() + ", " : "") + + apiCallSection.getParams() + + "]"; + } + public void failIfHasCatch(ClientYamlTestResponse response) { if (Strings.hasLength(catchParam) == false) { return; @@ -412,13 +420,13 @@ void checkElasticProductHeader(final List productHeaders) { } void checkWarningHeaders(final List warningHeaders) { - checkWarningHeaders(warningHeaders, null); + checkWarningHeaders(warningHeaders, null, null); } /** * Check that the response contains only the warning headers that we expect. */ - public void checkWarningHeaders(final List warningHeaders, String testPath) { + public void checkWarningHeaders(final List warningHeaders, String testPath, ApiCallSection apiCallDescription) { final List unexpected = new ArrayList<>(); final List unmatched = new ArrayList<>(); final List missing = new ArrayList<>(); @@ -494,6 +502,9 @@ public void checkWarningHeaders(final List warningHeaders, String testPa || missing.isEmpty() == false || missingRegex.isEmpty() == false) { final StringBuilder failureMessage = new StringBuilder(); + if (apiCallDescription != null) { + failureMessage.append(getApiCallDescription(apiCallDescription)).append(": "); + } appendBadHeaders(failureMessage, unexpected, "got unexpected warning header" + (unexpected.size() > 1 ? "s" : "")); appendBadHeaders(failureMessage, unmatched, "got unmatched warning header" + (unmatched.size() > 1 ? "s" : "")); appendBadHeaders(failureMessage, missing, "did not get expected warning header" + (missing.size() > 1 ? "s" : "")); diff --git a/x-pack/plugin/esql/qa/server/single-node/src/yamlRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlClientYamlAsyncSubmitAndFetchIT.java b/x-pack/plugin/esql/qa/server/single-node/src/yamlRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlClientYamlAsyncSubmitAndFetchIT.java index dc86293829979..5516b7731e6eb 100644 --- a/x-pack/plugin/esql/qa/server/single-node/src/yamlRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlClientYamlAsyncSubmitAndFetchIT.java +++ b/x-pack/plugin/esql/qa/server/single-node/src/yamlRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlClientYamlAsyncSubmitAndFetchIT.java @@ -80,7 +80,11 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx * warnings folks have asked for. */ original.failIfHasCatch(startResponse); - original.checkWarningHeaders(startResponse.getWarningHeaders(), testPath(executionContext)); + original.checkWarningHeaders( + startResponse.getWarningHeaders(), + testPath(executionContext), + original.getApiCallSection() + ); return; } @@ -102,7 +106,7 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx original.getApiCallSection().getNodeSelector() ); original.failIfHasCatch(fetchResponse); - original.checkWarningHeaders(fetchResponse.getWarningHeaders(), testPath(executionContext)); + original.checkWarningHeaders(fetchResponse.getWarningHeaders(), testPath(executionContext), original.getApiCallSection()); } catch (ClientYamlTestResponseException e) { original.checkResponseException(e, executionContext); } From bec05465423809150ccf8f092a09376c2032734c Mon Sep 17 00:00:00 2001 From: gmarouli Date: Fri, 27 Feb 2026 11:16:42 +0200 Subject: [PATCH 2/4] Log the mapping when the deprecation warning occurs. --- .../esql/qa/rest/FieldExtractorTestCase.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/FieldExtractorTestCase.java b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/FieldExtractorTestCase.java index 2a527a8c25e21..dd45331f46f7c 100644 --- a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/FieldExtractorTestCase.java +++ b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/FieldExtractorTestCase.java @@ -14,6 +14,7 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; +import org.elasticsearch.client.WarningFailureException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.settings.Settings; @@ -1411,19 +1412,25 @@ public void testTsIndexConflictingTypes() throws IOException { } } """, null, DEPRECATED_DEFAULT_METRIC_WARNING_HANDLER); - ESRestTestCase.createIndex("metrics-long", settings, """ - "properties": { - "@timestamp": { "type": "date" }, - "metric.name": { - "type": "keyword", - "time_series_dimension": true - }, - "metric.value": { - "type": "long", - "time_series_metric": "gauge" - } - } - """); + try { + ESRestTestCase.createIndex("metrics-long", settings, """ + "properties": { + "@timestamp": { "type": "date" }, + "metric.name": { + "type": "keyword", + "time_series_dimension": true + }, + "metric.value": { + "type": "long", + "time_series_metric": "gauge" + } + } + """); + } catch (WarningFailureException warningException) { + Map indexMapping = ESRestTestCase.getIndexMapping("metrics-long"); + logger.error("Received warning when creating index [metrics-long] with mapping [{}]", indexMapping); + throw warningException; + } ESRestTestCase.createIndex("metrics-long_dimension", settings, """ "properties": { "@timestamp": { "type": "date" }, From a05e86529cb4ae91ef8e5e7b1a267bff9257cead Mon Sep 17 00:00:00 2001 From: gmarouli Date: Fri, 27 Feb 2026 11:16:48 +0200 Subject: [PATCH 3/4] Unmute tests --- muted-tests.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index 1d584dc045bc0..54612d02c174b 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -341,9 +341,6 @@ tests: - class: org.elasticsearch.xpack.esql.core.util.RemoteClusterUtilsTests method: testQualifyAndJoinIndices issue: https://github.com/elastic/elasticsearch/issues/142442 -- class: org.elasticsearch.xpack.esql.qa.multi_node.FieldExtractorIT - method: testTsIndexConflictingTypes {NONE} - issue: https://github.com/elastic/elasticsearch/issues/142477 - class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT method: test {csv-spec:match-function.TestMatchWithReplace} issue: https://github.com/elastic/elasticsearch/issues/142501 @@ -353,9 +350,6 @@ tests: - class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlClientYamlIT method: test {p0=esql/160_union_types/suggested_type} issue: https://github.com/elastic/elasticsearch/issues/142525 -- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT - method: test {p0=esql/40_tsdb/TS Command grouping on text field} - issue: https://github.com/elastic/elasticsearch/issues/142544 - class: org.elasticsearch.xpack.esql.datasources.GlobDiscoveryLocalTests method: testRecursiveDoubleStarAllFiles issue: https://github.com/elastic/elasticsearch/issues/142576 @@ -374,9 +368,6 @@ tests: - class: org.elasticsearch.xpack.esql.tree.EsqlNodeSubclassTests method: testTransform {class org.elasticsearch.xpack.esql.plan.logical.MMR} issue: https://github.com/elastic/elasticsearch/issues/142674 -- class: org.elasticsearch.xpack.esql.qa.multi_node.FieldExtractorIT - method: testTsIndexConflictingTypes {null} - issue: https://github.com/elastic/elasticsearch/issues/142410 - class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeMetricsIT method: test issue: https://github.com/elastic/elasticsearch/issues/142739 From b9b6c486925e8f67b9090fcfa0b8d34388fe3951 Mon Sep 17 00:00:00 2001 From: gmarouli Date: Mon, 2 Mar 2026 10:41:30 +0200 Subject: [PATCH 4/4] Unmute similar test failure --- muted-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index e632e115c36d1..c0fad5be3dcbe 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -381,9 +381,6 @@ tests: - class: org.elasticsearch.compute.operator.exchange.BatchDriverTests method: testSinglePageSingleBatch issue: https://github.com/elastic/elasticsearch/issues/142895 -- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlClientYamlIT - method: test {p0=esql/40_tsdb/to_aggregate_metric_double with multi_values} - issue: https://github.com/elastic/elasticsearch/issues/142964 - class: org.elasticsearch.reindex.management.ReindexManagementClientYamlTestSuiteIT method: test {yaml=reindex/30_cancel_reindex/Cancel running reindex returns response and GET confirms completed} issue: https://github.com/elastic/elasticsearch/issues/142079