mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
add ExpectationNotMetError to Stud.try on monitoring_api_spec
in some tests against metrics api it's possible the values aren't there, making the assertion fail. By default Stud.try only catches StandardError, but rspec throws a RSpec::Expectations::ExpectationNotMetError on a failed assertion, and this exception inherits directly from Exception. This commit explicitly adds this exception to the list of Stud.try exceptions Fixes #7177
This commit is contained in:
parent
7537b62c8d
commit
412dd7bc08
1 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ 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) do
|
||||
Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
|
||||
# event_stats can fail if the stats subsystem isn't ready
|
||||
result = logstash_service.monitoring_api.event_stats rescue nil
|
||||
expect(result).not_to be_nil
|
||||
|
@ -39,7 +39,7 @@ describe "Test Monitoring API" do
|
|||
logstash_service.start_with_stdin
|
||||
logstash_service.wait_for_logstash
|
||||
|
||||
Stud.try(max_retry.times) do
|
||||
Stud.try(max_retry.times, [StandardError, 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
|
||||
|
@ -53,7 +53,7 @@ describe "Test Monitoring API" do
|
|||
logstash_service.start_with_stdin
|
||||
logstash_service.wait_for_logstash
|
||||
|
||||
Stud.try(max_retry.times) do
|
||||
Stud.try(max_retry.times, [StandardError, 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