Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,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
Expand All @@ -348,9 +345,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
Expand All @@ -369,9 +363,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.heap_attack.HeapAttackSubqueryIT
method: testManyRandomKeywordFieldsInSubqueryIntermediateResultsWithSortOneField
issue: https://github.com/elastic/elasticsearch/issues/141202
Expand All @@ -390,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -412,13 +420,13 @@ void checkElasticProductHeader(final List<String> productHeaders) {
}

void checkWarningHeaders(final List<String> 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<String> warningHeaders, String testPath) {
public void checkWarningHeaders(final List<String> warningHeaders, String testPath, ApiCallSection apiCallDescription) {
final List<String> unexpected = new ArrayList<>();
final List<String> unmatched = new ArrayList<>();
final List<String> missing = new ArrayList<>();
Expand Down Expand Up @@ -494,6 +502,9 @@ public void checkWarningHeaders(final List<String> 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" : ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, Object> 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" },
Expand Down