Skip to content

Commit

Permalink
added logging test
Browse files Browse the repository at this point in the history
  • Loading branch information
Robgra13 committed Oct 28, 2024
1 parent d57952d commit 2d31831
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/sidekiq_poison_pill_remedy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 2d31831

Please sign in to comment.