Skip to content

Commit 5274c16

Browse files
committed
[CI] Test Runner: Fix removing datastreams on cleanup
1 parent b67e115 commit 5274c16

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

api-spec-testing/test_file.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,6 @@ def clear_datafeeds(client)
324324
end
325325
end
326326

327-
def clear_datastreams(client)
328-
client.xpack.indices.delete_data_stream(name: '*', expand_wildcards: 'all')
329-
end
330-
331327
def clear_ml_jobs(client)
332328
client.xpack.ml.close_job(job_id: '_all', force: true)
333329
client.xpack.ml.get_jobs['jobs'].each do |d|
@@ -378,14 +374,19 @@ def clear_transforms(client)
378374
end
379375
end
380376

377+
def clear_datastreams(client)
378+
client.xpack.indices.delete_data_stream(name: '*', expand_wildcards: 'all')
379+
client.indices.delete_data_stream(name: '*', expand_wildcards: 'all')
380+
end
381+
381382
def clear_indices(client)
382383
client.indices.delete(index: '*', expand_wildcards: 'all', ignore: 404)
383384

384385
indices = client.indices.get(index: '_all', expand_wildcards: 'all').keys.reject do |i|
385-
i.start_with?('.security') || i.start_with?('.watches') || i.start_with?('.ds-')
386+
i.start_with?('.security') || i.start_with?('.watches')
386387
end
387388
indices.each do |index|
388-
client.indices.delete_alias(index: index, name: '*', ignore: 404)
389+
client.indices.delete_alias(index: index, name: '*', ignore: 404) unless index.start_with?('.ds')
389390
client.indices.delete(index: index, ignore: 404)
390391
end
391392
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => e

0 commit comments

Comments
 (0)