Skip to content

Commit 0e033f9

Browse files
jsvdelasticsearch-bot
authored andcommitted
fix pipeline spec that didn't wait for pipeline to terminate
this test only called "pipeline.start" and expected an output to receive the "do_close" method call. Therefore it relies on a race condition that the pipeline shuts down quickly enough, which could fail. This change ensures the pipeline fully terminated before making the assertion This commit also removes an unused let from the time when logstash output plugins had workers.
1 parent 5e1a08b commit 0e033f9

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

logstash-core/spec/logstash/pipeline_spec.rb

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -371,20 +371,6 @@ def flush(options)
371371
eos
372372
}
373373

374-
let(:test_config_with_output_workers) {
375-
<<-eos
376-
input {
377-
dummyinput {}
378-
}
379-
380-
output {
381-
dummyoutput {
382-
workers => 2
383-
}
384-
}
385-
eos
386-
}
387-
388374
context "output close" do
389375
let(:pipeline) { mock_pipeline_from_string(test_config_without_output_workers) }
390376
let(:output) { pipeline.outputs.first }
@@ -393,13 +379,9 @@ def flush(options)
393379
allow(output).to receive(:do_close)
394380
end
395381

396-
after do
397-
pipeline.shutdown
398-
end
399-
400382
it "should call close of output without output-workers" do
401383
pipeline.start
402-
384+
pipeline.shutdown
403385
expect(output).to have_received(:do_close).once
404386
end
405387
end

0 commit comments

Comments
 (0)