From 2d318311be31ecfaa21e2c54282e3da0655cd563 Mon Sep 17 00:00:00 2001 From: Robert Gradowski Date: Mon, 28 Oct 2024 11:24:04 +0100 Subject: [PATCH] added logging test --- spec/sidekiq_poison_pill_remedy_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/sidekiq_poison_pill_remedy_spec.rb b/spec/sidekiq_poison_pill_remedy_spec.rb index 3b655e0..a2845fb 100644 --- a/spec/sidekiq_poison_pill_remedy_spec.rb +++ b/spec/sidekiq_poison_pill_remedy_spec.rb @@ -20,6 +20,7 @@ allow_any_instance_of(Sidekiq::DeadSet).to receive(:find_job).with(enqueue_job).and_return(job) allow(Sentry).to receive(:capture_message).and_call_original + allow(Sidekiq.logger).to receive(:fatal) end context "when the job is a poison pill in non-poison pill queue" do @@ -36,6 +37,9 @@ level: :warning, extra: hash_including(:job_item) ) + expect(Sidekiq.logger).to have_received(:fatal).with( + "MyJob was marked as `poison pill`, please create the job memory optimizations ticket timely" + ) end end @@ -55,6 +59,9 @@ level: :critical, extra: hash_including(:job_item) ) + expect(Sidekiq.logger).to have_received(:fatal).with( + "MyJob failed in the `poison_pill`, this means that it has to be urgently optimized on memory usage" + ) end end end