mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
fix remaining race condition in monitoring api integration spec
* add NoMethodError to list of allowed exceptions in try
This commit is contained in:
parent
e73a4cb209
commit
55ad9850c8
1 changed files with 5 additions and 4 deletions
|
@ -26,9 +26,10 @@ describe "Test Monitoring API" do
|
|||
logstash_service.wait_for_logstash
|
||||
number_of_events.times { logstash_service.write_to_stdin("Hello world") }
|
||||
|
||||
Stud.try(max_retry.times, RSpec::Expectations::ExpectationNotMetError) do
|
||||
Stud.try(max_retry.times, [NoMethodError, RSpec::Expectations::ExpectationNotMetError]) do
|
||||
# event_stats can fail if the stats subsystem isn't ready
|
||||
result = logstash_service.monitoring_api.event_stats rescue {}
|
||||
result = logstash_service.monitoring_api.event_stats rescue nil
|
||||
expect(result).not_to be_nil
|
||||
expect(result["in"]).to eq(number_of_events)
|
||||
end
|
||||
end
|
||||
|
@ -38,7 +39,7 @@ describe "Test Monitoring API" do
|
|||
logstash_service.start_with_stdin
|
||||
logstash_service.wait_for_logstash
|
||||
|
||||
Stud.try(max_retry.times, RSpec::Expectations::ExpectationNotMetError) do
|
||||
Stud.try(max_retry.times, [NoMethodError, RSpec::Expectations::ExpectationNotMetError]) do
|
||||
# node_stats can fail if the stats subsystem isn't ready
|
||||
result = logstash_service.monitoring_api.node_stats rescue nil
|
||||
expect(result).not_to be_nil
|
||||
|
@ -52,7 +53,7 @@ describe "Test Monitoring API" do
|
|||
logstash_service.start_with_stdin
|
||||
logstash_service.wait_for_logstash
|
||||
|
||||
Stud.try(max_retry.times, RSpec::Expectations::ExpectationNotMetError) do
|
||||
Stud.try(max_retry.times, [NoMethodError, RSpec::Expectations::ExpectationNotMetError]) do
|
||||
# node_stats can fail if the stats subsystem isn't ready
|
||||
result = logstash_service.monitoring_api.node_stats rescue nil
|
||||
expect(result).not_to be_nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue