@@ -201,7 +201,7 @@ def finish(name, id, payload)
201201
202202 describe 'instrument' do
203203 after do
204- ActiveSupport ::Notifications . notifier . all_listeners_for ( notification_name ) . each do |listener |
204+ ActiveSupport ::Notifications . notifier . listeners_for ( notification_name ) . each do |listener |
205205 ActiveSupport ::Notifications . unsubscribe ( listener )
206206 end
207207 end
@@ -396,6 +396,12 @@ def finish(name, id, payload)
396396 end
397397
398398 it 'finishes spans even when block subscribers blow up' do
399+ # This scenario cannot be exercised reliably on Active Support < 7.0 since the #finish method
400+ # will never be called by the notifier if another subscriber raises an error.
401+ #
402+ # See this PR for additional details: https://github.com/rails/rails/pull/43282
403+ skip 'Active Support Notifications will break in these scenarions in Rails < 7.0' if ActiveSupport . version < Gem ::Version . new ( "7.0" )
404+
399405 ActiveSupport ::Notifications . subscribe ( notification_pattern ) { raise 'boom' }
400406 OpenTelemetry ::Instrumentation ::ActiveSupport . subscribe ( tracer , notification_pattern )
401407
@@ -409,6 +415,12 @@ def finish(name, id, payload)
409415 end
410416
411417 it 'finishes spans even when complex subscribers blow up' do
418+ # This scenario cannot be exercised reliably on Active Support < 7.0 since the #finish method
419+ # will never be called by the notifier if another subscriber raises an error.
420+ #
421+ # See this PR for additional details: https://github.com/rails/rails/pull/43282
422+ skip 'Active Support Notifications will break in these scenarions in Rails < 7.0' if ActiveSupport . version < Gem ::Version . new ( "7.0" )
423+
412424 ActiveSupport ::Notifications . subscribe ( notification_pattern , CrashingEndSubscriber . new )
413425 OpenTelemetry ::Instrumentation ::ActiveSupport . subscribe ( tracer , notification_pattern )
414426
0 commit comments