From fb8ce7d76e29027360c9ca901adc87760f1215e4 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 26 Jun 2023 09:47:00 +0800 Subject: [PATCH] DEV: Use `use_redis_snapshotting` in rate limiting test (#22270) Why is this change required? Prevents the test from leaking state in Redis and ends up causing other tests to become flaky. --- spec/lib/auth/default_current_user_provider_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/lib/auth/default_current_user_provider_spec.rb b/spec/lib/auth/default_current_user_provider_spec.rb index 39b84153f3b..9893401e3cc 100644 --- a/spec/lib/auth/default_current_user_provider_spec.rb +++ b/spec/lib/auth/default_current_user_provider_spec.rb @@ -202,6 +202,8 @@ RSpec.describe Auth::DefaultCurrentUserProvider do context "with rate limiting" do before { RateLimiter.enable } + use_redis_snapshotting + it "rate limits admin api requests" do global_setting :max_admin_api_reqs_per_minute, 3