diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/lib/gitlab/sidekiq_middleware_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/lib/gitlab/sidekiq_middleware_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware_spec.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/spec/lib/gitlab/sidekiq_middleware_spec.rb b/spec/lib/gitlab/sidekiq_middleware_spec.rb index 752ec6a0a3f..6fe61fb42a5 100644 --- a/spec/lib/gitlab/sidekiq_middleware_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware_spec.rb @@ -4,12 +4,17 @@ 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 + include ApplicationWorker + + def perform(_arg) + Gitlab::SafeRequestStore['gitaly_call_actual'] = 1 + Gitlab::GitalyClient.query_time = 5 + end end end @@ -32,8 +37,7 @@ describe Gitlab::SidekiqMiddleware do described_class.server_configurator( metrics: metrics, arguments_logger: arguments_logger, - memory_killer: memory_killer, - request_store: request_store + memory_killer: memory_killer ).call(chain) example.run @@ -52,6 +56,7 @@ describe Gitlab::SidekiqMiddleware do Gitlab::SidekiqMiddleware::ArgumentsLogger, Gitlab::SidekiqMiddleware::MemoryKiller, Gitlab::SidekiqMiddleware::RequestStoreMiddleware, + Gitlab::SidekiqMiddleware::ExtraDoneLogMetadata, Gitlab::SidekiqMiddleware::WorkerContext::Server, Gitlab::SidekiqMiddleware::AdminMode::Server, Gitlab::SidekiqMiddleware::DuplicateJobs::Server @@ -77,13 +82,11 @@ describe Gitlab::SidekiqMiddleware do let(:metrics) { false } let(:arguments_logger) { false } let(:memory_killer) { false } - let(:request_store) { false } let(:disabled_sidekiq_middlewares) do [ Gitlab::SidekiqMiddleware::ServerMetrics, Gitlab::SidekiqMiddleware::ArgumentsLogger, - Gitlab::SidekiqMiddleware::MemoryKiller, - Gitlab::SidekiqMiddleware::RequestStoreMiddleware + Gitlab::SidekiqMiddleware::MemoryKiller ] end @@ -94,7 +97,6 @@ describe Gitlab::SidekiqMiddleware do let(:metrics) { true } let(:arguments_logger) { true } let(:memory_killer) { true } - let(:request_store) { true } let(:disabled_sidekiq_middlewares) { [] } it_behaves_like "a server middleware chain" |