Commit 102f7b0b authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix leaky constant in sidekiq middleware spec

parent a62bea15
......@@ -375,7 +375,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/quick_actions/dsl_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_spec.rb'
- 'spec/lib/gitlab/view/presenter/factory_spec.rb'
- 'spec/lib/marginalia_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'
require 'sidekiq/testing'
describe Gitlab::SidekiqMiddleware do
class TestWorker
include Sidekiq::Worker
before do
stub_const('TestWorker', Class.new)
def perform(_arg)
Gitlab::SafeRequestStore['gitaly_call_actual'] = 1
Gitlab::GitalyClient.query_time = 5
TestWorker.class_eval do
include Sidekiq::Worker
def perform(_arg)
Gitlab::SafeRequestStore['gitaly_call_actual'] = 1
Gitlab::GitalyClient.query_time = 5
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