Suppress expected exceptions by report_on_exception = false

Follow up #31428 to address similar exceptions with mysql2 adapter
This commit is contained in:
Yasuo Honda 2017-12-14 19:30:50 +00:00
parent 659c516bef
commit 521c9468e2

@ -13,6 +13,7 @@ class Sample < ActiveRecord::Base
setup do
@abort, Thread.abort_on_exception = Thread.abort_on_exception, false
Thread.report_on_exception, @original_report_on_exception = false, Thread.report_on_exception if Thread.respond_to?(:report_on_exception)
@connection = ActiveRecord::Base.connection
@connection.clear_cache!
@ -31,6 +32,7 @@ class Sample < ActiveRecord::Base
@connection.drop_table "samples", if_exists: true
Thread.abort_on_exception = @abort
Thread.report_on_exception = @original_report_on_exception if Thread.respond_to?(:report_on_exception)
end
test "raises Deadlocked when a deadlock is encountered" do