Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sidekiq/testing
Worker.clear
API in sidekiq_unique_jobs/testing
Instead of reimplementing the logic, we use the upstream `Worker.clear` API in the `sidekiq_unique_jobs/testing` `Worker.clear` overwrite. This fixes an issue that causes an infinite loop in `drain_all` after calling `clear` on a worker class that has it's queue name defined as a symbol. Because `sidekiq/testing` uses strings as the keys for the internal state tracking calling `Sidekiq::Queues[queue].clear` cleared a queue that never contained a job, while leaving jobs in the "string-indexed" queue. This only actually works after [this][1] is merged into `sidekiq` until then the old behaviour remains the same (clearing workers with their queue name defined as strings is fine). [1]: sidekiq/sidekiq#5352
- Loading branch information