[go: up one dir, main page]

Skip to content

Follow-up from "Do not outdate merge train cars if skip-train setting is enabled"

The following discussion from !132325 (merged) should be addressed:

  • @group_9970_bot_58e69a7d2ace73c7373ac2bc2a5cabd0 started a discussion: (+1 comment)

          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 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?)

@drew: Please see the most recent commit in this MR: !132325 (04907840)

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.

Edited by 🤖 GitLab Bot 🤖