Fix flaky user_searches_for_issues_spec anonymous rate limit
What does this MR do and why?
Fix flaky test: anonymous search exhausts unauthenticated rate limit within a single example.
The test at line 218 (finds a work item, signed-out context) was failing
intermittently with a 429 Too Many Requests. When Capybara submits a search
and selects a scope, the UI fires concurrent background count requests for
every scope tab — all hitting SearchController#count which goes through
check_search_rate_limit! scoped to request.ip. With the default limit of
10 req/min for unauthenticated users, this is enough to trigger a 429 within
a single example.
The spec contains no tests for rate limiting behaviour, so replacing
:clean_gitlab_redis_rate_limiting (Redis cleanup only) with
:disable_rate_limiter (stubs throttled? to false) is the correct fix.
References
Screenshots or screen recordings
N/A - test-only change.
How to set up and validate locally
- Run the previously failing test in isolation:
bundle exec rspec spec/features/search/user_searches_for_issues_spec.rb:218 - Run the full spec file:
bundle exec rspec spec/features/search/user_searches_for_issues_spec.rb
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.