DEV: Move rate limiter disable to after :each for tests (#13986)

We weren't calling clear_all! for the rate limiter which
was the first problem, and the second problem was that it
is very odd to do state cleanup before tests instead of after,
so moved the disabling and clear_all! to after.
This commit is contained in:
Martin Brennan 2021-08-10 13:38:35 +10:00 committed by GitHub
parent fa952c036c
commit 52035dc665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,6 @@ module TestSetup
#
# Discourse.redis = DiscourseMockRedis.new
RateLimiter.disable
PostActionNotifier.disable
SearchIndexer.disable
UserActionManager.disable
@ -260,6 +259,8 @@ RSpec.configure do |config|
unfreeze_time
ActionMailer::Base.deliveries.clear
RateLimiter.disable
RateLimiter.clear_all!
if ActiveRecord::Base.connection_pool.stat[:busy] > 1
raise ActiveRecord::Base.connection_pool.stat.inspect