Follow-up from "Do not outdate merge train cars if skip-train setting is enabled"
The following discussion from !132325 should be addressed: - [ ] @group_9970_bot_58e69a7d2ace73c7373ac2bc2a5cabd0 started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132325#note_1581300341): (+1 comment) > > ```suggestion > let_it_be(:project) { create(:project, :public, :repository, creator: user, namespace: user.namespace) } > ``` > > Project creations are very slow. To improve test performance, consider using `let_it_be`, `build`, or `build_stubbed` instead. > > ⚠️ **Warning**: If your test modifies data, `let_it_be` may be unsuitable, and cause state leaks! Use `let_it_be_with_reload` or `let_it_be_with_refind` instead. > > Unsure which method to use? See the [testing best practices](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#optimize-factory-usage) > for background information and alternative options for optimizing factory usage. > > If you're concerned about causing state leaks, or if you know `let` or `let!` are the better options, ignore this comment. > > ([Improve this message?](https://gitlab.com/gitlab-org/gitlab/-/blob/master/tooling/danger/specs/project_factory_suggestion.rb)) > > > <!-- "generated_by_2677df" --> > @drew: > Please see the most recent commit in this MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132325/diffs?commit_id=04907840ea27057941dcf47404c1e15d6ee477be > > I've added a lot of extra setup here to avoid flakiness in these tests. There's a ton of shared state happening in this spec file that makes writing *multiple* tests that actually merge MRs very difficult. > > I'm opening a follow-up about this because it's a pain to work with, but certainly outside the scope of this MR.
issue