diff options
author | Gabriel Courtemanche <gabriel.courtemanche@shopify.com> | 2017-08-22 13:32:38 -0400 |
---|---|---|
committer | Gabriel Courtemanche <gabriel.courtemanche@shopify.com> | 2017-08-22 14:26:14 -0400 |
commit | c5edd97721aeaa4ceaa11e66327842a0aba1fdf7 (patch) | |
tree | de0f8edbdeeee40ec7eb7ec745ce49b58b0de627 /activerecord/test/cases/adapters/mysql2 | |
parent | 39e6eea9e54c93f836d79f0614f463bdcf95bab5 (diff) | |
download | rails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.tar.gz rails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.tar.bz2 rails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.zip |
Add TransactionTimeout for MySQL error code 1205
Diffstat (limited to 'activerecord/test/cases/adapters/mysql2')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/transaction_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/transaction_test.rb b/activerecord/test/cases/adapters/mysql2/transaction_test.rb index e603baab69..25d9f69a89 100644 --- a/activerecord/test/cases/adapters/mysql2/transaction_test.rb +++ b/activerecord/test/cases/adapters/mysql2/transaction_test.rb @@ -59,5 +59,11 @@ module ActiveRecord end end end + + test "raises TransactionTimeout when mysql raises ER_LOCK_WAIT_TIMEOUT" do + assert_raises(ActiveRecord::TransactionTimeout) do + ActiveRecord::Base.connection.execute("SIGNAL SQLSTATE 'HY000' SET MESSAGE_TEXT = 'Testing error', MYSQL_ERRNO = 1205;") + end + end end end |