In my tests I use the api to check that a job was enqueued, and then clear all queues after the test.
after(:each) do
Sidekiq::Queue.new.clear
Sidekiq::RetrySet.new.clear
Sidekiq::ScheduledSet.new.clear
end
But I notice, this doesn't reset the history.
stats.processed will keep climbing up. Is there a way to just clear the entire redis store?
Redis has a flushdb command.
On Jul 26, 2013, at 14:48, homanchou [email protected] wrote:
In my tests I use the api to check that a job was enqueued, and then clear all queues after the test.
after(:each) do
Sidekiq::Queue.new.clear
Sidekiq::RetrySet.new.clear
Sidekiq::ScheduledSet.new.clear
endBut I notice, this doesn't reset the history.
stats.processed will keep climbing up. Is there a way to just clear the entire redis store?
—
Reply to this email directly or view it on GitHub.
How do I execute that command within an rspec after filter? Is there a way to use Sidekiq to access the redis connection so I don't have to install anything else? Similar to ActiveRecord::Base.connection.execute(sql...)
Sidekiq.redis { |conn| conn.flushdb }
Most helpful comment