mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Test stabilization: Add retry to have_running_pipeline matcher
Fixes #7737 Fixes #7753
This commit is contained in:
parent
0c59550d65
commit
78d0d5a364
1 changed files with 7 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
require "rspec"
|
||||
require "rspec/expectations"
|
||||
require "logstash/config/pipeline_config"
|
||||
require "stud/try"
|
||||
|
||||
RSpec::Matchers.define :be_a_metric_event do |namespace, type, *args|
|
||||
match do
|
||||
|
@ -63,10 +64,12 @@ end
|
|||
|
||||
RSpec::Matchers.define :have_running_pipeline? do |pipeline_config|
|
||||
match do |agent|
|
||||
pipeline = agent.get_pipeline(pipeline_config.pipeline_id)
|
||||
expect(pipeline).to_not be_nil
|
||||
expect(pipeline.config_str).to eq(pipeline_config.config_string)
|
||||
expect(pipeline.running?).to be_truthy
|
||||
Stud.try(10.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
|
||||
pipeline = agent.get_pipeline(pipeline_config.pipeline_id)
|
||||
expect(pipeline).to_not be_nil
|
||||
expect(pipeline.config_str).to eq(pipeline_config.config_string)
|
||||
expect(pipeline.running?).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
failure_message do |agent|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue