mperham/sidekiq — pull request #455 by sj26 (2012-10-19 04:33:43+00:00)
Title: Testing clear_all and drain_all

Just floating an idea, not sure if you'll like it.

In a few apps now we've ended up adding clear_all and drain_all functionality to things like rspec and cucumber hooks. This just makes it easier.

Investigated using inclusion tracking a la ActiveSupport's DependencyTracker, but this doesn't catch the Sidekiq::Extensions workers and potentially other workers defined prior to inclusion of sidekiq/testing.

A couple of potential issues:

* queues are not considered
* drain_all runs jobs grouped by worker, not in queued order
* jobs added while jobs are being drained may not get processed