Don't share the request_store across specs and sidekiq middleware
Right now, we have a :request_store
tag that enables the request store for the entire spec.
We also have a Gitlab::SidekiqMiddleware::RequestStore
that enables the request-store for the runtime of a job.
We don't enable this middleware when the request store was already enabled in the spec. When a sidekiq job runs inline, it will have access to the request store that was started by the spec, meaning it will share it's contents.
We should figure out a way to separate these two.
The following discussion from !29509 (merged) should be addressed:
-
@smcgivern started a discussion: (+4 comments) We can if the spec itself doesn't use RequestStore, right? And that might be important, because I had an issue where a spec passed - because RequestStore was enabled for the spec - but the actual code failed, because my middleware did something after the RequestStore middleware finished.