diff options
Diffstat (limited to 'activejob/test/support/integration/adapters')
-rw-r--r-- | activejob/test/support/integration/adapters/async.rb | 9 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/que.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/sidekiq.rb | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/activejob/test/support/integration/adapters/async.rb b/activejob/test/support/integration/adapters/async.rb new file mode 100644 index 0000000000..42beb12b1f --- /dev/null +++ b/activejob/test/support/integration/adapters/async.rb @@ -0,0 +1,9 @@ +module AsyncJobsManager + def setup + ActiveJob::Base.queue_adapter = :async + end + + def clear_jobs + ActiveJob::AsyncJob::QUEUES.clear + end +end diff --git a/activejob/test/support/integration/adapters/que.rb b/activejob/test/support/integration/adapters/que.rb index ff5235bdc8..0cd8952a28 100644 --- a/activejob/test/support/integration/adapters/que.rb +++ b/activejob/test/support/integration/adapters/que.rb @@ -23,7 +23,7 @@ module QueJobsManager @thread = Thread.new do loop do - Que::Job.work("integration_tests") + Que::Job.work sleep 0.5 end end diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index 4988cdb33f..9aa07bcb52 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -57,8 +57,8 @@ module SidekiqJobsManager concurrency: 1, timeout: 1, }) - Sidekiq.poll_interval = 0.5 - Sidekiq::Scheduled.const_set :INITIAL_WAIT, 1 + Sidekiq.average_scheduled_poll_interval = 0.5 + Sidekiq.options[:poll_interval_average] = 1 begin sidekiq.run continue_write.puts "started" |