File tree 3 files changed +18
-4
lines changed
3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ def initialize
176
176
@enable_db_query_source = true
177
177
@db_query_source_threshold_ms = 100
178
178
@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
180
180
end
181
181
end
182
182
end
Original file line number Diff line number Diff line change @@ -85,7 +85,9 @@ class FailedJobWithRetryOn < FailedJob
85
85
86
86
RSpec . describe "ActiveJob integration" , type : :job do
87
87
before do
88
- make_basic_app
88
+ make_basic_app do |config |
89
+ config . rails . active_job_report_after_job_retries = false
90
+ end
89
91
end
90
92
91
93
let ( :event ) do
@@ -218,6 +220,7 @@ def post.to_global_id
218
220
before do
219
221
make_basic_app do |config |
220
222
config . traces_sample_rate = 1.0
223
+ config . rails . active_job_report_after_job_retries = false
221
224
end
222
225
end
223
226
@@ -261,7 +264,9 @@ def post.to_global_id
261
264
262
265
context "when DeserializationError happens in user's jobs" do
263
266
before do
264
- make_basic_app
267
+ make_basic_app do |config |
268
+ config . rails . active_job_report_after_job_retries = false
269
+ end
265
270
end
266
271
267
272
class DeserializationErrorJob < ActiveJob ::Base
@@ -441,7 +446,16 @@ def perform(event, hint)
441
446
end
442
447
end
443
448
449
+
444
450
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
+
445
459
it "reports 3 exceptions" do
446
460
allow ( Sentry ::Rails ::ActiveJobExtensions ::SentryReporter )
447
461
. to receive ( :capture_exception ) . and_call_original
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class MySubscriber; end
62
62
63
63
describe "#active_job_report_after_job_retries" do
64
64
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 )
66
66
end
67
67
end
68
68
end
You can’t perform that action at this time.
0 commit comments