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