Loading
Fix flaky custom roles spec in group repository settings
What does this MR do and why?
Fixes the dominant flake in ee/spec/features/groups/settings/repository_spec.rb (384 flake events since 2026-08-03):
expected to find text "Custom roles" in "Roles Developers + Maintainers Maintainers Instance admins No one"The flake was introduced by 01b3728e, which replaced the mocked getMemberRoles with a real API call and added create(:member_role, namespace: group) in an inner before hook. RSpec runs outer before hooks first, so the page was visited before the member role existed. The access dropdown fetches member roles asynchronously after page load, so whether the fetch saw the newly created role was a timing race, and opening the dropdown does not re-fetch.
This MR creates the member role via let_it_be, which runs in before(:all) and therefore deterministically precedes the outer before hook's visit.
Related to #623104 (closed)
How to set up and validate locally
bin/rspec ee/spec/features/groups/settings/repository_spec.rb