mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
specs: don't start ES connection pool when only validating config
Accidentally succeeding at connecting to an HTTP resource that is not a real, live Elasticsearch (such as an Elastic Cloud instance that has been shut down and reaped) can cause client initialization to fail.
This commit is contained in:
parent
2c9cf09e88
commit
04a3852428
1 changed files with 7 additions and 0 deletions
|
@ -38,6 +38,13 @@ describe LogStash::LicenseChecker::LicenseReader do
|
|||
LogStash::Helpers::ElasticsearchOptions.es_options_from_settings('monitoring', system_settings)
|
||||
end
|
||||
|
||||
before(:each) do
|
||||
# We do _not_ want the client's connection pool to start on initialization, as error conditions
|
||||
# from accidentally succeeding at establishing a connection to an HTTP resource that's not actually
|
||||
# a live Elasticsearch (e.g., reaped cloud instance) can cause errors.
|
||||
allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:start)
|
||||
end
|
||||
|
||||
subject { described_class.new(system_settings, 'monitoring', elasticsearch_options) }
|
||||
|
||||
describe '#fetch_xpack_info' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue