diff --git a/Gemfile.lock b/Gemfile.lock index ae1a95fc753..1e6a27de004 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -403,7 +403,7 @@ GEM public_suffix (4.0.6) puma (5.5.2) nio4r (~> 2.0) - que (0.14.3) + que (1.0.0) raabro (1.4.0) racc (1.6.0) rack (2.2.3) diff --git a/activejob/test/support/integration/adapters/que.rb b/activejob/test/support/integration/adapters/que.rb index dd387f9f722..7be7c3ed333 100644 --- a/activejob/test/support/integration/adapters/que.rb +++ b/activejob/test/support/integration/adapters/que.rb @@ -4,8 +4,6 @@ module QueJobsManager def setup require "sequel" ActiveJob::Base.queue_adapter = :que - Que.mode = :off - Que.worker_count = 1 end def clear_jobs @@ -21,14 +19,13 @@ module QueJobsManager %x{#{"PGPASSWORD=\"#{pass}\"" if pass} psql -X -c 'drop database if exists "#{db}"' -U #{user} -t template1} %x{#{"PGPASSWORD=\"#{pass}\"" if pass} psql -X -c 'create database "#{db}"' -U #{user} -t template1} Que.connection = Sequel.connect(que_url) - Que.migrate! + Que.migrate!(version: Que::Migrations::CURRENT_VERSION) - @thread = Thread.new do - loop do - Que::Job.work("integration_tests") - sleep 0.5 - end - end + @locker = Que::Locker.new( + queues: ["integration_tests"], + poll_interval: 0.5, + worker_priorities: [nil] + ) rescue Sequel::DatabaseConnectionError puts "Cannot run integration tests for que. To be able to run integration tests for que you need to install and start postgresql.\n" @@ -37,6 +34,6 @@ module QueJobsManager end def stop_workers - @thread.kill + @locker.stop! end end