Skip to content

Testing clear_all and drain_all#455

Merged
mperham merged 1 commit intosidekiq:masterfrom
sj26:testing-clear-and-drain-all-workers
Oct 19, 2012
Merged

Testing clear_all and drain_all#455
mperham merged 1 commit intosidekiq:masterfrom
sj26:testing-clear-and-drain-all-workers

Conversation

@sj26
Copy link
Contributor

@sj26 sj26 commented Oct 19, 2012

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

This may be too far down the path of reimplementing sidekiq in-memory for testing.

@mperham
Copy link
Collaborator

mperham commented Oct 19, 2012

Hot!!

mperham added a commit that referenced this pull request Oct 19, 2012
@mperham mperham merged commit e793ea9 into sidekiq:master Oct 19, 2012
@sj26 sj26 deleted the testing-clear-and-drain-all-workers branch September 28, 2016 04:54
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

Successfully merging this pull request may close these issues.

2 participants