Resolve "Namespace factory is problematic"
What does this MR do?
Improve the namespace factory to workaround User#ensure_namespace_correct
creating another namespace.
Are there points in the code the reviewer needs to double check?
We need to keep in mind that this only tries to address the issues in the tests, not production nor database. We'll address the database issue in https://gitlab.com/gitlab-org/gitlab-ce/issues/43292
Why was this MR needed?
This caused a lot of weird ~"broken master" issues because the result is not deterministic. Database would be happily to pick one namespace or the other, by its mood. This caused a lot of inconsistent results.
Does this MR meet the acceptance criteria?
-
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
What are the relevant issue numbers?
Closes #42936 (closed)
Edited by Lin Jen-Shin