Commit 8f14d3c1 authored by Shinya Maeda's avatar Shinya Maeda

Fix sidekiq memory killer warning message

parent 52af120f
......@@ -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