aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/integration
diff options
context:
space:
mode:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-05-07 15:57:33 +0200
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-05-07 21:48:50 +0200
commit52d131826e46d1a4606b71ddbf57db0f75f040e0 (patch)
treebe507d4c0fa5f2dfc0dcba6210099d7d1b75f6bf /activejob/test/integration
parentd84bfaa8530e42188f0361efb5a61c73948192e6 (diff)
downloadrails-52d131826e46d1a4606b71ddbf57db0f75f040e0.tar.gz
rails-52d131826e46d1a4606b71ddbf57db0f75f040e0.tar.bz2
rails-52d131826e46d1a4606b71ddbf57db0f75f040e0.zip
Let Sidekiq set provider_job_id
When a job is added to Sidekiq by ActiveJob, make sure we still can get the original job_id provider by Sidekiq. We do this by adding the sidekiq jid to provider_job_id field on the job object. Partly fixes #18821 Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'activejob/test/integration')
-rw-r--r--activejob/test/integration/queuing_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb
index 403b803558..f2665221b8 100644
--- a/activejob/test/integration/queuing_test.rb
+++ b/activejob/test/integration/queuing_test.rb
@@ -61,4 +61,14 @@ class QueuingTest < ActiveSupport::TestCase
test_job = TestJob.perform_later @id
assert_kind_of Fixnum, test_job.provider_job_id
end
+
+ test 'should supply a provider_job_id to Sidekiq' do
+ skip unless adapter_is?(:sidekiq)
+ test_job = TestJob.perform_later @id
+ refute test_job.provider_job_id.nil?, "Provider job id should be set by Sidekiq"
+
+ delayed_test_job = TestJob.set(wait: 1.minute).perform_later @id
+ refute delayed_test_job.provider_job_id.nil?,
+ "Provider job id should by set for delayed jobs by sidekiq"
+ end
end