Skip to content

[CE backport] Fix RequestStore-related EE-only test failure

Michael Kozono requested to merge mk/backport-fix-safe-request-store-test into master

What does this MR do?

Backports an EE-only fix to keep the codebases more similar.

Commit body:

The test was failing https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/101444126 because https://gitlab.com/gitlab-org/gitlab-ee/blob/a04056efad6639420b469eced5130751a8cf2757/ee/spec/support/request_store.rb which is in EE only, clears the RequestStore before every test, regardless of whether RequestStore is active. This test is unusual because it sets up RequestStore without it being active, to make sure that the tested code doesn’t attempt to use RequestStore. These two unusual facts combined to cause the failure in EE only. The fix works because of the particular order of RSpec hooks in the test lifecycle.

What are the relevant issue numbers?

See https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7481#note_104240845

Does this MR meet the acceptance criteria?

Edited by Yorick Peterse

Merge request reports