mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
This commit fixes the startup of the Logstash service during packaging
tests by adding a minimal pipeline config. Without it, the service was
flapping from start to start and vice versa causing test flakiness.
Relates https://github.com/elastic/logstash/issues/15784
(cherry picked from commit b66dc7f460
)
Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
This commit is contained in:
parent
283d02ffb5
commit
bdbd811d3e
4 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,7 @@ RSpec.shared_examples "installable" do |logstash|
|
|||
before(:each) do
|
||||
logstash.uninstall
|
||||
logstash.install({:version => LOGSTASH_VERSION})
|
||||
logstash.write_default_pipeline
|
||||
end
|
||||
|
||||
it "is installed on [#{logstash.human_name}]" do
|
||||
|
|
|
@ -28,6 +28,7 @@ RSpec.shared_examples "installable_with_jdk" do |logstash|
|
|||
before(:each) do
|
||||
logstash.uninstall
|
||||
logstash.install({:bundled_jdk => true, :version => LOGSTASH_VERSION})
|
||||
logstash.write_default_pipeline
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
|
|
|
@ -135,6 +135,11 @@ module ServiceTester
|
|||
client.install(package)
|
||||
end
|
||||
|
||||
def write_default_pipeline()
|
||||
# defines a minimal pipeline so that the service is able to start
|
||||
client.write_pipeline("input { heartbeat {} } output { null {} }")
|
||||
end
|
||||
|
||||
def uninstall
|
||||
client.uninstall(name)
|
||||
end
|
||||
|
|
|
@ -123,6 +123,10 @@ module ServiceTester
|
|||
run_command("curl -fsSL --retry 5 --retry-delay 5 #{from} -o #{to}")
|
||||
end
|
||||
|
||||
def write_pipeline(pipeline_string)
|
||||
run_command("bash -c \"echo '#{pipeline_string}' >/etc/logstash/conf.d/pipeline.conf\"")
|
||||
end
|
||||
|
||||
def delete_file(path)
|
||||
run_command("rm -rf #{path}")
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue