fix failing test due to faulty api request

fixes https://github.com/elastic/logstash/issues/7086

Fixes #7144
This commit is contained in:
Joao Duarte 2017-05-18 10:26:46 +01:00 committed by João Duarte
parent b6c855a0a6
commit 8b2490bad8

View file

@ -138,6 +138,7 @@ describe "Test Logstash instance" do
end
def get_id
# make sure logstash is up and running when calling this
JSON.parse(open("http://localhost:9600/").read)["id"]
end
@ -149,10 +150,11 @@ describe "Test Logstash instance" do
@ls1.wait_for_logstash
}
start_ls.call()
first_id = get_id
# we use a try since logstash may have started but the webserver may not yet
first_id = try(num_retries) { get_id }
@ls1.teardown
start_ls.call()
second_id = get_id
second_id = try(num_retries) { get_id }
expect(first_id).to eq(second_id)
end
end