Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is SidekiqUnique behaviour applied to regular Workers? #100

Closed
pik opened this issue Aug 6, 2015 · 1 comment
Closed

Why is SidekiqUnique behaviour applied to regular Workers? #100

pik opened this issue Aug 6, 2015 · 1 comment

Comments

@pik
Copy link
Contributor

pik commented Aug 6, 2015

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
@mhenrixon
Copy link
Owner

This should be a none issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants