mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Call Discourse.redis.flushdb after the end of each test (#29117)
There have been too many flaky tests as a result of leaking state in Redis so it is easier to resolve them by ensuring we flush Redis' database. Locally on my machine, calling `Discourse.redis.flushdb` takes around 0.1ms which means this change will have very little impact on test runtimes.
This commit is contained in:
committed by
GitHub
parent
44fe8c62d6
commit
ed6c9d1545
@@ -716,7 +716,6 @@ RSpec.configure do |config|
|
||||
|
||||
Capybara.reset_session!
|
||||
MessageBus.backend_instance.reset! # Clears all existing backlog from memory backend
|
||||
Discourse.redis.flushdb
|
||||
end
|
||||
|
||||
config.after :each do |example|
|
||||
@@ -743,6 +742,7 @@ RSpec.configure do |config|
|
||||
|
||||
unfreeze_time
|
||||
ActionMailer::Base.deliveries.clear
|
||||
Discourse.redis.flushdb
|
||||
end
|
||||
|
||||
config.before(:each, type: :multisite) do
|
||||
|
||||
Reference in New Issue
Block a user