diff --git a/judoscale-sidekiq/test/benchmarks/collect_benchmark.rb b/judoscale-sidekiq/test/benchmarks/collect_benchmark.rb index 9dac26e3..deef9a33 100644 --- a/judoscale-sidekiq/test/benchmarks/collect_benchmark.rb +++ b/judoscale-sidekiq/test/benchmarks/collect_benchmark.rb @@ -41,12 +41,15 @@ def with_isolated_redis(n, &block) # n is in powers of 10, but we want to use a database number in the range 1-9 db_number = Math.log10(n).to_i - # `new_redis_pool` will use the configuration from Sidekiq.default_configuration - Sidekiq.default_configuration.redis = {db: db_number} - pool = Sidekiq.default_configuration.new_redis_pool 10, "bench-#{n}" - Sidekiq::Client.via(pool, &block) - - # For older (pre-capsule) versions of Sidekiq - # Sidekiq.redis = {db: db_number} + if Sidekiq.respond_to?(:default_configuration) + # `new_redis_pool` will use the configuration from Sidekiq.default_configuration + Sidekiq.default_configuration.redis = {db: db_number} + pool = Sidekiq.default_configuration.new_redis_pool 10, "bench-#{n}" + Sidekiq::Client.via(pool, &block) + else + # For older (pre-capsule) versions of Sidekiq + Sidekiq.redis = {db: db_number} + block.call + end end end diff --git a/judoscale-sidekiq/test/test_helper.rb b/judoscale-sidekiq/test/test_helper.rb index 6d531d4a..8ee20321 100644 --- a/judoscale-sidekiq/test/test_helper.rb +++ b/judoscale-sidekiq/test/test_helper.rb @@ -5,7 +5,6 @@ require "minitest/autorun" require "minitest/spec" -require "debug" module Judoscale::Test end