diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-10 17:50:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 17:50:37 -0400 |
commit | 66ab9c74dd6232e85952e7324fcb130b33576d38 (patch) | |
tree | 77d6285f26f90d84fad6272170dc3a39f2cec19e /activejob/test | |
parent | 621a4e77cf0b245ae740b2ff1bab5e356363ab45 (diff) | |
parent | fc4e7d44c8cd9e0521fbd259ec241c4ba56f1db7 (diff) | |
download | rails-66ab9c74dd6232e85952e7324fcb130b33576d38.tar.gz rails-66ab9c74dd6232e85952e7324fcb130b33576d38.tar.bz2 rails-66ab9c74dd6232e85952e7324fcb130b33576d38.zip |
Merge pull request #33823 from stoodfarback/aj_backburner_fix_priority
ActiveJob Backburner adapter: fix priority
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/integration/queuing_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb index 32afb5ca62..96253773c7 100644 --- a/activejob/test/integration/queuing_test.rb +++ b/activejob/test/integration/queuing_test.rb @@ -137,4 +137,16 @@ class QueuingTest < ActiveSupport::TestCase assert job_executed "#{@id}.2" assert job_executed_at("#{@id}.2") < job_executed_at("#{@id}.1") end + + test "should run job with higher priority first in Backburner" do + skip unless adapter_is?(:backburner) + + jobs_manager.tube.pause(3) + TestJob.set(priority: 20).perform_later "#{@id}.1" + TestJob.set(priority: 10).perform_later "#{@id}.2" + wait_for_jobs_to_finish_for(10.seconds) + assert job_executed "#{@id}.1" + assert job_executed "#{@id}.2" + assert job_executed_at("#{@id}.2") < job_executed_at("#{@id}.1") + end end |