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,7 +4,10 @@ require 'spec_helper' ...@@ -4,7 +4,10 @@ require 'spec_helper'
require 'sidekiq/testing' require 'sidekiq/testing'
describe Gitlab::SidekiqMiddleware do describe Gitlab::SidekiqMiddleware do
class TestWorker before do
stub_const('TestWorker', Class.new)
TestWorker.class_eval do
include Sidekiq::Worker include Sidekiq::Worker
def perform(_arg) def perform(_arg)
...@@ -12,6 +15,7 @@ describe Gitlab::SidekiqMiddleware do ...@@ -12,6 +15,7 @@ describe Gitlab::SidekiqMiddleware do
Gitlab::GitalyClient.query_time = 5 Gitlab::GitalyClient.query_time = 5
end end
end end
end
around do |example| around do |example|
Sidekiq::Testing.inline! { example.run } Sidekiq::Testing.inline! { example.run }
......
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