Skip to content

Add wait between retries of SSO settings

Sanad Liaquat requested to merge qa-shl-fix-group-saml-flakiness into master

What does this MR do?

Adds wait between retries of SSO settings. Elements for SSO settings such as "Enable group managed accounts" and "Enforce SSO" are animated. (This issue might not manifest after gitlab-qa!360 (merged) and !22217 (merged) are merged but it does not hurt to keep this fix anyways). There is a check after hitting these elements to see if they are enabled, but due to the animation delay, they might not be reported as enabled/disabled right away (see attached video). To avoid the problem, the related code was wrapped in a retry but again the check to see if enabled happed right after the hit and would at times fail. Waiting between retry would ensure that on a second pass, the hit does not happen but the condition succeeds.

Another obvious solution would have been:

            def enable_group_managed_accounts
              click_element :group_managed_accounts_toggle_button unless find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
              Support::Waiter.wait do
                find_element(:group_managed_accounts_toggle_button)[:class].include?('is-checked')
              end
            end

But this solution does not cover the case of hit-miss which was the reason of adding the Support::Retrier.retry_until in the first place.

Also adds a log statement for deleting a user via API.

Video demonstrating the delay between clicking the switch and setting of is-checked value in class:

switch_animation

Closes #55242 (closed)

Conformity

Edited by Sanad Liaquat

Merge request reports