Skip to content

Avoid expect_any_instance_of in transfer service spec

Lin Jen-Shin requested to merge avoid-expect_any_instance_of into master

What does this MR do?

Avoid expect_any_instance_of because it doesn't work well with prepend

Are there points in the code the reviewer needs to double check?

Sometimes it's extremely convenient with expect_any_instance_of or allow_any_instance_of, however it does introduce some issues with prepend, as we're using it more and more.

It's very hard to rewrite all the existing tests, and it could also be much more complicated to do so.

In an ideal world, we should not use them, but it's certainly attractive to use them. I am not sure how to find the right balance here.

Why was this MR needed?

Fixes https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/26183762 (Note that this only happens in EE because EE has prepend while CE doesn't)

What are the relevant issue numbers?

This was discovered in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2554#note_36312731

Merge request reports