mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
#7087 Fixed unstable test from premature exit of user defined pipeline
Fixes #7133
This commit is contained in:
parent
f0302f100d
commit
0c282105eb
1 changed files with 29 additions and 18 deletions
|
@ -48,33 +48,44 @@ describe LogStash::Agent do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "system pipeline" do
|
context "system pipeline" do
|
||||||
let(:finite_pipeline_config) { mock_pipeline_config(:main, "input { generator { count => 1000 } } output { null {} }") }
|
|
||||||
let(:system_pipeline_config) { mock_pipeline_config(:system_pipeline, "input { generator { } } output { null {} }", { "pipeline.system" => true }) }
|
let(:system_pipeline_config) { mock_pipeline_config(:system_pipeline, "input { generator { } } output { null {} }", { "pipeline.system" => true }) }
|
||||||
|
|
||||||
let(:source_loader) do
|
|
||||||
TestSourceLoader.new(finite_pipeline_config, system_pipeline_config)
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when we have a finite pipeline and a system pipeline running" do
|
context "when we have a finite pipeline and a system pipeline running" do
|
||||||
|
|
||||||
|
let(:finite_pipeline_config) { mock_pipeline_config(:main, "input { generator { count => 1000 } } output { null {} }") }
|
||||||
|
|
||||||
|
let(:source_loader) do
|
||||||
|
TestSourceLoader.new(finite_pipeline_config, system_pipeline_config)
|
||||||
|
end
|
||||||
|
|
||||||
it "execute the pipeline and stop execution" do
|
it "execute the pipeline and stop execution" do
|
||||||
expect(subject.execute).to eq(0)
|
expect(subject.execute).to eq(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#running_user_defined_pipelines" do
|
context "when we have an infinite pipeline and a system pipeline running" do
|
||||||
it "returns the user defined pipelines" do
|
let(:infinite_pipeline_config) { mock_pipeline_config(:main, "input { generator { } } output { null {} }") }
|
||||||
agent_task = start_agent(subject)
|
|
||||||
expect(subject.running_user_defined_pipelines.keys).to include(:main)
|
|
||||||
expect(subject.running_user_defined_pipelines.keys).not_to include(:system_pipeline)
|
|
||||||
subject.shutdown
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#running_user_defined_pipelines?" do
|
let(:source_loader) do
|
||||||
it "returns true" do
|
TestSourceLoader.new(infinite_pipeline_config, system_pipeline_config)
|
||||||
agent_task = start_agent(subject)
|
end
|
||||||
expect(subject.running_user_defined_pipelines?).to be_truthy
|
|
||||||
subject.shutdown
|
describe "#running_user_defined_pipelines" do
|
||||||
|
it "returns the user defined pipelines" do
|
||||||
|
start_agent(subject)
|
||||||
|
expect(subject.running_user_defined_pipelines.keys).to include(:main)
|
||||||
|
expect(subject.running_user_defined_pipelines.keys).not_to include(:system_pipeline)
|
||||||
|
subject.shutdown
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#running_user_defined_pipelines?" do
|
||||||
|
it "returns true" do
|
||||||
|
start_agent(subject)
|
||||||
|
expect(subject.running_user_defined_pipelines?).to be_truthy
|
||||||
|
subject.shutdown
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue