Sha256: 89c973cb94c18f384793f351d8d07a115927f632c8edbc1d2fbb2456f71a154f

Contents?: true

Size: 1.44 KB

Versions: 24

Compression:

Stored size: 1.44 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

    value(session_lock_wait_timeout).must_equal global_lock_wait_timeout + Lhm::Invoker::LOCK_WAIT_TIMEOUT_DELTA
    value(session_innodb_lock_wait_timeout).must_equal global_innodb_lock_wait_timeout + Lhm::Invoker::LOCK_WAIT_TIMEOUT_DELTA
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
lhm-shopify-4.4.2 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.4.1 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.4.0 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.3.0 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.2.3 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.2.2 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.2.1 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.2.0 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.1.1 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.1.0 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-4.0.0 spec/integration/lock_wait_timeout_spec.rb
lhm-teak-3.6.4 spec/integration/lock_wait_timeout_spec.rb
lhm-teak-3.6.3 spec/integration/lock_wait_timeout_spec.rb
lhm-teak-3.6.2 spec/integration/lock_wait_timeout_spec.rb
lhm-teak-3.6.1 spec/integration/lock_wait_timeout_spec.rb
lhm-teak-3.6.0 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-3.5.5 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-3.5.4 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-3.5.3 spec/integration/lock_wait_timeout_spec.rb
lhm-shopify-3.5.2 spec/integration/lock_wait_timeout_spec.rb