diff --git a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb index 90387e5cb4e..b37b13a26af 100644 --- a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb +++ b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb @@ -59,6 +59,8 @@ let(:agent_task) { start_agent(agent) } before :each do + @existing_api_enabled = LogStash::SETTINGS.get_value("api.enabled") + LogStash::SETTINGS.set_value("api.enabled", webserver_enabled) agent agent_task @@ -86,6 +88,7 @@ after :each do agent.shutdown agent_task.wait + LogStash::SETTINGS.set_value("api.enabled", @existing_api_enabled) LogStash::SETTINGS.set_value("monitoring.enabled", false) end