Skip to content

Make sure job deduplication doesn't leak across spec runs

In !29509 (merged) we've enabled running all sidekiq middleware in specs.

The middleware for job deduplication adds an idempotency key in the sidekiq-client middleware, and it removes it again when the job runs using Sidekiq::Testing.inline! or Sidekiq::Worker.drain_all!. But if the job wasn't actually run the key would not get removed.

This could happen if the spec suite was interupted, or if a job was deliberately scheduled but not run.

To avoid this we should clean up redis when using the sidekiq_inline helpers