I've been updating the tests for the run_lock PR and noticed this behaviour.
For example AfterYield Worker is defined with unique: false
https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec%2Fsupport%2Fafter_yield_worker.rb
But there are tests which still expect it to unlock: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec%2Flib%2Fserver%2Fmiddleware_spec.rb#L90
In fact this fails:
class RegularWorker
include Sidekiq::Worker
sidekiq_options queue: QUEUE
def perform(*)
true
end
end
context "#RegularWorker" do
it "unlock is never called for a worker not using unique extension" do
jid = RegularWorker.perform_async('test')
item = Sidekiq::Queue.new(QUEUE).find_job(jid).item
expect(@middleware).not_to receive(:unlock)
@middleware.call(RegularWorker.new, item, QUEUE) do
true
end
end
end
I've been updating the tests for the run_lock PR and noticed this behaviour.
For example AfterYield Worker is defined with unique: false
https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec%2Fsupport%2Fafter_yield_worker.rb
But there are tests which still expect it to unlock: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec%2Flib%2Fserver%2Fmiddleware_spec.rb#L90
In fact this fails: