Skip to content

Commit e7bba82

Browse files
committed
Fix test execute after disconnect, AR change of behaviour
1 parent a5fe20d commit e7bba82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/db/mysql/simple_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,12 @@ def test_jdbc_error
447447
def test_execute_after_disconnect
448448
connection.disconnect!
449449

450-
assert_raise(ActiveRecord::ConnectionNotEstablished) do
451-
connection.execute('SELECT 1')
450+
# active record change of behaviour 7.1, reconnects on query execution.
451+
result = assert_nothing_raised do
452+
connection.execute('SELECT 1 + 2')
452453
end
453454

455+
assert_equal 3, result.rows.flatten.first
454456
ensure
455457
connection.reconnect!
456458
end

0 commit comments

Comments
 (0)