Commit 46c650ab authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-27' into 'master'

Fix leaky constant in sidekiq middleware spec

See merge request gitlab-org/gitlab!32101
parents 5cddf3a9 102f7b0b
...@@ -375,7 +375,6 @@ RSpec/LeakyConstantDeclaration: ...@@ -375,7 +375,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/quick_actions/dsl_spec.rb' - 'spec/lib/gitlab/quick_actions/dsl_spec.rb'
- 'spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb'
- 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
- 'spec/lib/gitlab/sidekiq_middleware_spec.rb'
- 'spec/lib/gitlab/view/presenter/factory_spec.rb' - 'spec/lib/gitlab/view/presenter/factory_spec.rb'
- 'spec/lib/marginalia_spec.rb' - 'spec/lib/marginalia_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb' - 'spec/lib/omni_auth/strategies/jwt_spec.rb'
......
---
title: Fix leaky constant issue in sidekiq middleware spec
merge_request: 32101
author: Rajendra Kadam
type: fixed
...@@ -4,12 +4,16 @@ require 'spec_helper' ...@@ -4,12 +4,16 @@ require 'spec_helper'
require 'sidekiq/testing' require 'sidekiq/testing'
describe Gitlab::SidekiqMiddleware do describe Gitlab::SidekiqMiddleware do
class TestWorker before do
include Sidekiq::Worker stub_const('TestWorker', Class.new)
def perform(_arg) TestWorker.class_eval do
Gitlab::SafeRequestStore['gitaly_call_actual'] = 1 include Sidekiq::Worker
Gitlab::GitalyClient.query_time = 5
def perform(_arg)
Gitlab::SafeRequestStore['gitaly_call_actual'] = 1
Gitlab::GitalyClient.query_time = 5
end
end end
end 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