File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ def initialize
176176 @enable_db_query_source = true
177177 @db_query_source_threshold_ms = 100
178178 @active_support_logger_subscription_items = Sentry ::Rails ::ACTIVE_SUPPORT_LOGGER_SUBSCRIPTION_ITEMS_DEFAULT . dup
179- @active_job_report_after_job_retries = false
179+ @active_job_report_after_job_retries = true
180180 end
181181 end
182182 end
Original file line number Diff line number Diff line change @@ -85,7 +85,9 @@ class FailedJobWithRetryOn < FailedJob
8585
8686RSpec . describe "ActiveJob integration" , type : :job do
8787 before do
88- make_basic_app
88+ make_basic_app do |config |
89+ config . rails . active_job_report_after_job_retries = false
90+ end
8991 end
9092
9193 let ( :event ) do
@@ -218,6 +220,7 @@ def post.to_global_id
218220 before do
219221 make_basic_app do |config |
220222 config . traces_sample_rate = 1.0
223+ config . rails . active_job_report_after_job_retries = false
221224 end
222225 end
223226
@@ -261,7 +264,9 @@ def post.to_global_id
261264
262265 context "when DeserializationError happens in user's jobs" do
263266 before do
264- make_basic_app
267+ make_basic_app do |config |
268+ config . rails . active_job_report_after_job_retries = false
269+ end
265270 end
266271
267272 class DeserializationErrorJob < ActiveJob ::Base
@@ -441,7 +446,16 @@ def perform(event, hint)
441446 end
442447 end
443448
449+
444450 context "when active_job_report_after_job_retries is false" do
451+ before do
452+ Sentry . configuration . rails . active_job_report_after_job_retries = false
453+ end
454+
455+ after do
456+ Sentry . configuration . rails . active_job_report_after_job_retries = true
457+ end
458+
445459 it "reports 3 exceptions" do
446460 allow ( Sentry ::Rails ::ActiveJobExtensions ::SentryReporter )
447461 . to receive ( :capture_exception ) . and_call_original
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class MySubscriber; end
6262
6363 describe "#active_job_report_after_job_retries" do
6464 it "has correct default value" do
65- expect ( subject . active_job_report_after_job_retries ) . to eq ( false )
65+ expect ( subject . active_job_report_after_job_retries ) . to be ( true )
6666 end
6767 end
6868end
You can’t perform that action at this time.
0 commit comments