Skip to content

Use Admin API Client When Creating Groups in E2E Tests

What does this MR do and why?

Related Issue: #365401 (closed)

It appears that when certain QA tests run for the first time on a non-live environment (master, package-and-qa, etc.), it can intermittently get into a bad state where a non-admin user created within the test ends up creating and becoming the owner of the top-level gitlab-qa-sandbox-group-*. After the test is complete, when it attempts to delete this user, the following error is returned, potentially due to recent work done in Unify member management between projects and gr... (&7405)

{"message":"User cannot be removed while is the sole-owner of a group”}

From there, subsequent tests continue to still use this user for various API calls that require admin access, leading to 403 Forbidden errors

This will hopefully allow the initial sandbox group creation to be created by the admin as expected, and allow the users to be deleted successfully. (Since on creating a group, it uses the given api client to create the sandbox group as well)

We may likely need to follow up with a fix at the framework level and other tests may need to be updated as well.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andrejs Cunskis

Merge request reports