mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
ensure pipeline terminates execution before doing assertion
This test relies on the generator input sending 10 events and observing the output. Calling shutdown immediately after start can cause the plugin to abort earily. This change waits for the execution to finish before performing the test assertions.
This commit is contained in:
parent
29d7dcef94
commit
c4834e55ee
1 changed files with 1 additions and 0 deletions
|
@ -903,6 +903,7 @@ describe LogStash::JavaPipeline do
|
|||
it "correctly distributes events" do
|
||||
pipeline = mock_java_pipeline_from_string(config, pipeline_settings_obj)
|
||||
pipeline.start
|
||||
sleep 0.01 until pipeline.finished_execution?
|
||||
pipeline.shutdown
|
||||
expect(output.events.size).to eq(60)
|
||||
expect(output.events.count {|e| e.get("cloned") == "cloned"}).to eq(30)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue