Sha256: 7c36b5d8c17fa9cf5b8d67f85ebcd18f61830ce945ff8fd10907e629273fcaa5

Contents?: true

Size: 767 Bytes

Versions: 25

Compression:

Stored size: 767 Bytes

Contents

require "cases/helper"

class MysqlConnectionTest < ActiveRecord::TestCase
  def setup
    @connection = ActiveRecord::Base.connection
  end

  def test_no_automatic_reconnection_after_timeout
    assert @connection.active?
    @connection.update('set @@wait_timeout=1')
    sleep 2
    assert !@connection.active?
  end

  def test_successful_reconnection_after_timeout_with_manual_reconnect
    assert @connection.active?
    @connection.update('set @@wait_timeout=1')
    sleep 2
    @connection.reconnect!
    assert @connection.active?
  end

  def test_successful_reconnection_after_timeout_with_verify
    assert @connection.active?
    @connection.update('set @@wait_timeout=1')
    sleep 2
    @connection.verify!(0)
    assert @connection.active?
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
3mix-castronaut-0.5.0.2 vendor/activerecord/test/cases/connection_test_mysql.rb
masover-castronaut-0.4.4.4 vendor/activerecord/test/cases/connection_test_mysql.rb
masover-castronaut-0.4.4.5 vendor/activerecord/test/cases/connection_test_mysql.rb
masover-castronaut-0.5.0.1 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.1 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.2 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.3 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.4 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.5 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.4.6 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.5.0 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.5.1 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.5.2 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.5.3 vendor/activerecord/test/cases/connection_test_mysql.rb
relevance-castronaut-0.5.4 vendor/activerecord/test/cases/connection_test_mysql.rb
radiant-0.7.2 vendor/rails/activerecord/test/cases/connection_test_mysql.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activerecord/test/cases/connection_test_mysql.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activerecord/test/cases/connection_test_mysql.rb
activerecord-2.1.0 test/cases/connection_test_mysql.rb
activerecord-2.1.2 test/cases/connection_test_mysql.rb