Skip to content

Fix `Auth::SamlGroupSyncWorker` flaky tests

What does this MR do and why?

Resolves

Closes MRs

manage_group_ids parameter is set in https://gitlab.com/gitlab-org/gitlab/-/blob/a066ca306c6e61e052fd845a18896ae842c89efc/ee/app/workers/system_access/base_global_group_sync_worker.rb#L20. Since we use Group.with_saml_group_links.select(:id, 'traversal_ids[1] as root_id') SQL query that does not guarantee order of manage_group_ids values, it leads to specs flakiness because the specs assertions assume ordered list of manage_group_ids. This MR fixes those assertions to ignore order of values within manage_group_ids to eliminate those spec flakiness. That change does not decrease the test coverage.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Bogdan Denkovych

Merge request reports

Loading