Skip to content

Commit 8d3cedf

Browse files
authored
Ensure generic enqueuer is reset correctly (#4258)
1 parent 487580b commit 8d3cedf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spec/unit/jobs/generic_enqueuer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def perform
2121

2222
before do
2323
# Reset singleton instance to ensure clean tests
24-
Thread.current[:generic_enqueuer] = nil
24+
GenericEnqueuer.reset!
2525
end
2626

2727
describe '.shared' do

spec/unit/jobs/reoccurring_job_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def perform
7373
it 'keeps the delayed job\'s priority when re-enqueuing' do
7474
TestConfig.config[:jobs][:priorities] = { 'fake-job': 20 }
7575

76+
Jobs::GenericEnqueuer.reset! # Ensure no previous state interferes
77+
7678
pollable_job = Jobs::Enqueuer.new({ queue: Jobs::Queues.generic, priority: 22 }).enqueue_pollable(FakeJob.new)
7779
expect(Delayed::Job.where(guid: PollableJobModel.first.delayed_job_guid).first[:priority]).to eq(42)
7880

0 commit comments

Comments
 (0)