Sha256: ad4b8b8f6bcd2f3c0266aa648103a5cfca849aa02ae9bdf9ef6410a075a4386c
Contents?: true
Size: 1.43 KB
Versions: 3
Compression:
Stored size: 1.43 KB
Contents
require File.expand_path(File.dirname(__FILE__)) + '/integration_helper' describe Lhm do include IntegrationHelper before(:each) do connect_master! table_create(:users) end it 'set_session_lock_wait_timeouts should set the sessions lock wait timeouts to less than the global values by a delta' do connection = Lhm.send(:connection) connection.execute('SET GLOBAL innodb_lock_wait_timeout=11') connection.execute('SET GLOBAL lock_wait_timeout=11') connection.execute('SET SESSION innodb_lock_wait_timeout=1') connection.execute('SET SESSION lock_wait_timeout=1') global_innodb_lock_wait_timeout = connection.select_one("SHOW GLOBAL VARIABLES LIKE 'innodb_lock_wait_timeout'")['Value'].to_i global_lock_wait_timeout = connection.select_one("SHOW GLOBAL VARIABLES LIKE 'lock_wait_timeout'")['Value'].to_i invoker = Lhm::Invoker.new(Lhm::Table.parse(:users, connection), connection) invoker.set_session_lock_wait_timeouts session_innodb_lock_wait_timeout = connection.select_one("SHOW SESSION VARIABLES LIKE 'innodb_lock_wait_timeout'")['Value'].to_i session_lock_wait_timeout = connection.select_one("SHOW SESSION VARIABLES LIKE 'lock_wait_timeout'")['Value'].to_i session_lock_wait_timeout.must_equal global_lock_wait_timeout + Lhm::Invoker::LOCK_WAIT_TIMEOUT_DELTA session_innodb_lock_wait_timeout.must_equal global_innodb_lock_wait_timeout + Lhm::Invoker::LOCK_WAIT_TIMEOUT_DELTA end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lhm-shopify-3.4.0 | spec/integration/lock_wait_timeout_spec.rb |
lhm-shopify-3.3.6 | spec/integration/lock_wait_timeout_spec.rb |
lhm-shopify-3.3.5 | spec/integration/lock_wait_timeout_spec.rb |