Commit b720ea06 authored by Michael Kozono's avatar Michael Kozono

Fix RequestStore-related test failure

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.
parent 09203420
......@@ -219,11 +219,11 @@ describe Gitlab::SafeRequestStore do
end
context 'when RequestStore is NOT active' do
around do |example|
before do
RequestStore.write('foo', true)
end
example.run
after do
RequestStore.clear! # Clean up
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment