Fix flaky spec in spec/system/rails_admin/list_cloud_activations_for_billing_account_spec.rb
Problem
There was a flaky failure in spec/system/rails_admin/list_cloud_activations_for_billing_account_spec.rb:18 which I think has been encountered before:
Failures:
1) List Cloud Activations for Billing Account when billing account has no subscriptions shows an appropriate message
Got 2 failures:
1.1) Failure/Error: expect(page).to have_content('Cloud Activations')
expected to find text "Cloud Activations" in "CustomersDot Admin Cloud License Statistics Dashboard Home admin@customers.gitlab.local Log out Navigation Admin users Billing accounts Billing account contacts Billing account invites Billing account memberships Cloud activations Community Program Coupon Codes Customers Failed Temporary Extensions Instance review settings Licenses License seat links Orders Reconciliations Temporary Extensions Provision Tracking Gitlab Namespaces Sync Attempts Provisions Trials License seat links for trials Self-Managed Trials Trial accounts Trial cloud activations Zuora local copy Rate Plan Charge Tiers Rate Plan Charges Rate Plans Subscriptions Fulfillment Platform Revenue Impact errors Salesforce errors Links Help Documentation List of Billing accounts Dashboard Billing accounts List Add new History Add filter Refresh Zuora account name Zuora account number Zuora account entity Zuora account Zuora account vat Salesforce account Membership count Created at Updated at GitLab AKByCeTt2 ts lSPDsX8yYEqeeUzCL3aqTNkbLP6V3ccx - tKUfZVIBwsR0015JCd 0 2025-08-22 06:09 2025-08-22 06:09 1 billing account". (However, it was found 2 times using a case insensitive search and it was found 1 time including non-visible text.)
[Screenshot Image]: /builds/gitlab-org/customers-gitlab-com/tmp/capybara/failures_r_spec_example_groups_list_cloud_activations_for_billing_account_when_billing_account_has_no_subscriptions_shows_an_appropriate_message_374.png
# ./spec/system/rails_admin/list_cloud_activations_for_billing_account_spec.rb:21:in `block (3 levels) in <top (required)>'
1.2) Failure/Error: expect(page).to have_content('This Billing Account has no Cloud Activations.')
expected to find text "This Billing Account has no Cloud Activations." in "CustomersDot Admin Cloud License Statistics Dashboard Home admin@customers.gitlab.local Log out Navigation Admin users Billing accounts Billing account contacts Billing account invites Billing account memberships Cloud activations Community Program Coupon Codes Customers Failed Temporary Extensions Instance review settings Licenses License seat links Orders Reconciliations Temporary Extensions Provision Tracking Gitlab Namespaces Sync Attempts Provisions Trials License seat links for trials Self-Managed Trials Trial accounts Trial cloud activations Zuora local copy Rate Plan Charge Tiers Rate Plan Charges Rate Plans Subscriptions Fulfillment Platform Revenue Impact errors Salesforce errors Links Help Documentation List of Billing accounts Dashboard Billing accounts List Add new History Add filter Refresh Zuora account name Zuora account number Zuora account entity Zuora account Zuora account vat Salesforce account Membership count Created at Updated at GitLab AKByCeTt2 ts lSPDsX8yYEqeeUzCL3aqTNkbLP6V3ccx - tKUfZVIBwsR0015JCd 0 2025-08-22 06:09 2025-08-22 06:09 1 billing account"
[Screenshot Image]: /builds/gitlab-org/customers-gitlab-com/tmp/capybara/failures_r_spec_example_groups_list_cloud_activations_for_billing_account_when_billing_account_has_no_subscriptions_shows_an_appropriate_message_374.png
# ./spec/system/rails_admin/list_cloud_activations_for_billing_account_spec.rb:22:in `block (3 levels) in <top (required)>'
Finished in 5 minutes 6 seconds (files took 15.34 seconds to load)
275 examples, 1 failure, 13 pending
Failed examples:
rspec ./spec/system/rails_admin/list_cloud_activations_for_billing_account_spec.rb:18 # List Cloud Activations for Billing Account when billing account has no subscriptions shows an appropriate message
Randomized with seed 53376
Since it's only one tracked occurrence, the spec won't be quarantined at the time of issue creation. If the flakiness starts to show more often, the spec should however be quarantined.
Proposal
Investigate and resolve the flakiness.
Result
A more stable test suite for this spec.