From d835edd75df211f0654a3a85215aa495ef3961e3 Mon Sep 17 00:00:00 2001 From: abicky Date: Sat, 5 Oct 2024 20:47:10 +0900 Subject: [PATCH] Increase sleep time to fix flaky test InnoDB seems to raise the error "Lock wait timeout exceeded" more than innodb_lock_wait_timeout seconds. --- .../ext/connection_adapters/abstract_mysql_adapter_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/activerecord/debug_errors/ext/connection_adapters/abstract_mysql_adapter_spec.rb b/spec/activerecord/debug_errors/ext/connection_adapters/abstract_mysql_adapter_spec.rb index d76df70..03d0dfd 100644 --- a/spec/activerecord/debug_errors/ext/connection_adapters/abstract_mysql_adapter_spec.rb +++ b/spec/activerecord/debug_errors/ext/connection_adapters/abstract_mysql_adapter_spec.rb @@ -74,10 +74,11 @@ def cause_deadlock(role:) ths = Array.new(2) do Thread.new do + Thread.current.abort_on_exception = true User.transaction do barrier.await(1) User.lock.find_by!(name: 'foo') - sleep 2 + sleep 5 end end end