If you tag your examples with something that requires this setup, then declare a context level hook, the setup will be run before example contexts (`describe` and `context` blocks) that will require it, if your code uses a circuit breaker this can mean it is only run once per suite.
```
# in your spec_helper.rb
module ExpensiveSetup
module_function
def perform
@perform ||=
begin
# expensive setup
end
end
end
RSpec.configure do |config|
config.before(:context, :expensive_elastic_search_setup => true) do
ExpensiveSetup.perform
end
end
# in your specs
RSpec.describe "some tricky search stuff", :expensive_elastic_search_setup => true do
# ...
end
```