Skip to content

Commit 23769da

Browse files
authored
Work around testFilterByTags failure (#125109)
A SDK bug[^1] means that these values sometimes don't parse as an integer. We don't need them to do so in order to pass the test, so this commit relaxes the test to accept any string. Closes #125090 Closes #125166 [^1]: aws/aws-sdk-java-v2#5968
1 parent edc36aa commit 23769da

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

muted-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,6 @@ tests:
402402
- class: org.elasticsearch.xpack.ilm.DataStreamAndIndexLifecycleMixingTests
403403
method: testGetDataStreamResponse
404404
issue: https://github.com/elastic/elasticsearch/issues/125083
405-
- class: org.elasticsearch.discovery.ec2.Ec2DiscoveryTests
406-
method: testFilterByTags
407-
issue: https://github.com/elastic/elasticsearch/issues/125090
408405
- class: org.elasticsearch.threadpool.ScalingThreadPoolTests
409406
method: testScalingThreadPoolConfiguration
410407
issue: https://github.com/elastic/elasticsearch/issues/125142

plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ protected List<TransportAddress> buildDynamicHosts(Settings nodeSettings, int no
103103
final String[] params = request.split("&");
104104
Arrays.stream(params).filter(entry -> entry.startsWith("Filter.") && entry.contains("=tag%3A")).forEach(entry -> {
105105
final int startIndex = "Filter.".length();
106-
final int filterId = Integer.parseInt(entry.substring(startIndex, entry.indexOf(".", startIndex)));
106+
// TODO ensure the filterId is an ASCII int when https://github.com/aws/aws-sdk-java-v2/issues/5968 fixed
107+
final var filterId = entry.substring(startIndex, entry.indexOf(".", startIndex));
107108
tagsIncluded.put(
108109
entry.substring(entry.indexOf("=tag%3A") + "=tag%3A".length()),
109110
Arrays.stream(params)

0 commit comments

Comments
 (0)