diff options
author | Andrew White <andrew.white@unboxedconsulting.com> | 2015-09-18 07:10:38 +0100 |
---|---|---|
committer | Andrew White <andrew.white@unboxedconsulting.com> | 2015-09-21 14:02:41 +0100 |
commit | a22523abcd4281b1632c75771e87a55c141aa339 (patch) | |
tree | 83eb9f35c764191b1504fe5c6d06b2fe2258e30a /activejob/test/support/integration | |
parent | 2e501ac9c42be8c6ef3fd10bd7eba8f84143611a (diff) | |
download | rails-a22523abcd4281b1632c75771e87a55c141aa339.tar.gz rails-a22523abcd4281b1632c75771e87a55c141aa339.tar.bz2 rails-a22523abcd4281b1632c75771e87a55c141aa339.zip |
Use Sidekiq.options to set initial wait
The INITIAL_WAIT constant has moved to the Sidekiq::Poller class but
rather than setting the constant directly we can override it via the
`:poll_interval_average` option.
This was causing random build failures because the test was waiting
for 10 seconds for the job to execute but the initial wait was a
random value between 10 and 15 seconds.
Diffstat (limited to 'activejob/test/support/integration')
-rw-r--r-- | activejob/test/support/integration/adapters/sidekiq.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index d9938600f2..9aa07bcb52 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -58,7 +58,7 @@ module SidekiqJobsManager timeout: 1, }) Sidekiq.average_scheduled_poll_interval = 0.5 - Sidekiq::Scheduled.const_set :INITIAL_WAIT, 1 + Sidekiq.options[:poll_interval_average] = 1 begin sidekiq.run continue_write.puts "started" |