Skip to content

Commit 5e1a08b

Browse files
jsvdelasticsearch-bot
authored andcommitted
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.
1 parent fd98f2e commit 5e1a08b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

logstash-core/spec/logstash/java_pipeline_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ def flush(options)
903903
it "correctly distributes events" do
904904
pipeline = mock_java_pipeline_from_string(config, pipeline_settings_obj)
905905
pipeline.start
906+
sleep 0.01 until pipeline.finished_execution?
906907
pipeline.shutdown
907908
expect(output.events.size).to eq(60)
908909
expect(output.events.count {|e| e.get("cloned") == "cloned"}).to eq(30)

0 commit comments

Comments
 (0)