mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Handle Elasticsearch errors better during DLQ integration tests
Give more time for Elasticsearch to start up, and retry after 503 responses Fixes #8175
This commit is contained in:
parent
efe06e329c
commit
0ad70ff5b4
1 changed files with 10 additions and 4 deletions
|
@ -43,14 +43,20 @@ describe "Test Dead Letter Queue" do
|
|||
es_service = @fixture.get_service("elasticsearch")
|
||||
es_client = es_service.get_client
|
||||
# Wait for es client to come up
|
||||
sleep(15)
|
||||
sleep(20)
|
||||
# test if all data was indexed by ES, but first refresh manually
|
||||
es_client.indices.refresh
|
||||
|
||||
logstash_service.wait_for_logstash
|
||||
try(75) do
|
||||
result = es_client.search(index: 'logstash-*', size: 0, q: '*')
|
||||
expect(result["hits"]["total"]).to eq(1000)
|
||||
try(60) do
|
||||
begin
|
||||
result = es_client.search(index: 'logstash-*', size: 0, q: '*')
|
||||
hits = result["hits"]["total"]
|
||||
rescue Elasticsearch::Transport::Transport::Errors::ServiceUnavailable => e
|
||||
puts "Elasticsearch unavailable #{e.inspect}"
|
||||
hits = 0
|
||||
end
|
||||
expect(hits).to eq(1000)
|
||||
end
|
||||
|
||||
result = es_client.search(index: 'logstash-*', size: 1, q: '*')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue