Skip to content

Commit 601e3d0

Browse files
committed
Remove finalize from NullSession
`finalize_session` should not be able to be called if a session has not been started, we should never have a `NullSession` when we get there. So we can remove the guard altogether to help make it obvious if this sort of thing does happen when it's not supposed to.
1 parent 3694e16 commit 601e3d0

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

activerecord/lib/active_record/asynchronous_queries_tracker.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ class << self
77
def active?
88
true
99
end
10-
11-
def finalize
12-
end
1310
end
1411
end
1512

activerecord/test/cases/adapter_test.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -408,20 +408,6 @@ def test_async_query_foreground_fallback
408408
ensure
409409
ActiveSupport::Notifications.unsubscribe(subscriber) if subscriber
410410
end
411-
412-
def test_async_query_finalize_with_null_session
413-
assert_nothing_raised do
414-
@connection.select_all "SELECT * FROM posts", async: true
415-
end
416-
417-
@connection.transaction do
418-
assert_raises AsynchronousQueryInsideTransactionError do
419-
@connection.select_all "SELECT * FROM posts", async: true
420-
end
421-
end
422-
ensure
423-
ActiveRecord::Base.asynchronous_queries_tracker.finalize_session
424-
end
425411
end
426412

427413
class AsynchronousQueriesTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)