elastic / logstash-devutils

An assortment of tooling/libraries to make Logstash core and plugin development and releasing a bit easier.
Apache License 2.0
17 stars 29 forks source link

shared specs: make interruptible input spec allowable lag configurable #94

Closed yaauie closed 3 years ago

yaauie commented 3 years ago

The S3 input is having a problem where the shared input shutdown spec is consistently failing in CI on Logstash 6.x because that plugin takes ~3.1s to fully shut down.

This PR introduces an allowed_lag (default: 3) to replace the hard-coded 3 second value to allow plugins to declare how long they are willing to wait in validating the plugin's interruptibility.

To use it, add a block to your rspec it_behaves_like block and define your own allowed_lag:

it_behaves_like "an interruptible input plugin" do
  let(:allowed_lag) { 4 } if LOGSTASH_VERSION.split('.').first.to_i <= 6
end