mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08: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
@ -221,8 +221,6 @@ RSpec.describe Invite do
|
||||
3.times { Invite.generate(user, email: "test@example.com") }
|
||||
end
|
||||
|
||||
use_redis_snapshotting
|
||||
|
||||
it "raises an error" do
|
||||
expect { Invite.generate(user, email: "test@example.com") }.to raise_error(
|
||||
RateLimiter::LimitExceeded,
|
||||
|
Reference in New Issue
Block a user