Commit 7bab7b69 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-sidekiq-memory-killer-warn-message' into 'master'

Fix sidekiq memory killer warning message

Closes gitlab-com/gl-infra/infrastructure#7371

See merge request gitlab-org/gitlab-ce!31264
parents f10295b2 8f14d3c1
......@@ -84,7 +84,7 @@ module Gitlab
end
def warn(message, signal: nil)
Sidekiq.logger.warn(class: worker.class, pid: pid, signal: signal, message: message)
Sidekiq.logger.warn(class: worker.class.name, pid: pid, signal: signal, message: message)
end
end
end
......
......@@ -4,7 +4,7 @@ describe Gitlab::SidekiqMiddleware::MemoryKiller do
subject { described_class.new }
let(:pid) { 999 }
let(:worker) { double(:worker, class: 'TestWorker') }
let(:worker) { double(:worker, class: ProjectCacheWorker) }
let(:job) { { 'jid' => 123 } }
let(:queue) { 'test_queue' }
......@@ -46,7 +46,10 @@ describe Gitlab::SidekiqMiddleware::MemoryKiller do
expect(Process).to receive(:kill).with('SIGKILL', pid).ordered
expect(Sidekiq.logger)
.to receive(:warn).with(class: 'TestWorker', message: anything, pid: pid, signal: anything).at_least(:once)
.to receive(:warn).with(class: 'ProjectCacheWorker',
message: anything,
pid: pid,
signal: anything).at_least(:once)
run
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