Skip to content

Commit 80c048d

Browse files
nielsbaumanmridula-s109
authored andcommitted
Fix data stream stats YAML test (elastic#129813)
Occasional shard allocation issues were causing the YAML tests to fail because the shard that had the document with the max timestamp in it would be unavailable. Fixes elastic#118217
1 parent 98a6ab8 commit 80c048d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,19 @@ setup:
185185
body: { "@timestamp": 1593639468350 }
186186
refresh: true
187187

188+
# Wait for the shards to be allocated to avoid missing results in the stats request
189+
# See https://github.com/elastic/elasticsearch/issues/118217#issuecomment-2996315057 for more context
190+
- do:
191+
cluster.health:
192+
index: simple-data-stream1,simple-data-stream2
193+
wait_for_status: green
194+
wait_for_no_relocating_shards: true
195+
188196
- do:
189197
indices.data_streams_stats: {}
198+
- match: { _shards.total: 3 }
199+
- match: { _shards.successful: 3 }
200+
- match: { _shards.failed: 0 }
190201
- match: { data_stream_count: 2 }
191202
- match: { backing_indices: 3 }
192203
- length: { data_streams: 2 }

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ tests:
102102
- class: org.elasticsearch.packaging.test.ArchiveTests
103103
method: test51AutoConfigurationWithPasswordProtectedKeystore
104104
issue: https://github.com/elastic/elasticsearch/issues/118212
105-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
106-
method: test {p0=data_stream/120_data_streams_stats/Multiple data stream}
107-
issue: https://github.com/elastic/elasticsearch/issues/118217
108105
- class: org.elasticsearch.xpack.ccr.rest.ShardChangesRestIT
109106
method: testShardChangesNoOperation
110107
issue: https://github.com/elastic/elasticsearch/issues/118800

0 commit comments

Comments
 (0)