diff --git a/test/database.yml b/test/database.yml index e8f529e..dd810b1 100644 --- a/test/database.yml +++ b/test/database.yml @@ -36,7 +36,6 @@ test_pool_1_db_a: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true # Mimic configurations as read by active_record_shards/ar_flexmaster test_pool_1_db_a_replica: @@ -46,7 +45,6 @@ test_pool_1_db_a_replica: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true slave: true test_pool_1_db_b: @@ -56,7 +54,6 @@ test_pool_1_db_b: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_not_there: adapter: <%= adapter %> @@ -65,7 +62,6 @@ test_pool_1_db_not_there: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_2_db_d: adapter: <%= adapter %> @@ -75,7 +71,6 @@ test_pool_2_db_d: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true test_pool_2_db_e: adapter: <%= adapter %> @@ -85,7 +80,6 @@ test_pool_2_db_e: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true test_pool_3_db_e: adapter: <%= adapter %> @@ -95,7 +89,6 @@ test_pool_3_db_e: password: host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true # test_pool_1_db_c needs to be the last database defined in the file # otherwise the test_models_with_matching_hosts_and_non_matching_databases_issue_exists_without_arhp_patch @@ -107,4 +100,3 @@ test_pool_1_db_c: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true diff --git a/test/test_arhp.rb b/test/test_arhp.rb index 0b4c570..bb4f621 100644 --- a/test/test_arhp.rb +++ b/test/test_arhp.rb @@ -186,6 +186,8 @@ def test_underlying_assumption_about_test_db Pool2DbD.connection.execute("KILL #{thread_id}") end + switch_to_klass.connection.reconnect! + # and finally, did mysql reconnect correctly? puts "\nAnd now we end up on #{current_database(switch_to_klass)}" if debug_me assert_equal expected_database, current_database(switch_to_klass) diff --git a/test/three_tier_database.yml b/test/three_tier_database.yml index 44ab0db..9a5ae4b 100644 --- a/test/three_tier_database.yml +++ b/test/three_tier_database.yml @@ -43,7 +43,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true # Mimic configurations as read by active_record_shards/ar_flexmaster test_pool_1_db_a_replica: @@ -53,7 +52,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true replica: true test_pool_1_db_b: @@ -63,7 +61,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_c: adapter: <%= adapter %> @@ -72,7 +69,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_not_there: adapter: <%= adapter %> @@ -81,7 +77,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_shard_a: adapter: <%= adapter %> @@ -90,7 +85,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_shard_b: adapter: <%= adapter %> @@ -99,7 +93,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_shard_b_replica: adapter: <%= adapter %> @@ -108,7 +101,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true replica: true test_pool_1_db_shard_c: @@ -118,7 +110,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true test_pool_1_db_shard_c_replica: adapter: <%= adapter %> @@ -127,7 +118,6 @@ test: username: <%= mysql.user %> password: "<%= mysql.password %>" host: <%= mysql.host %> - reconnect: true replica: true test_pool_2_db_shard_d: @@ -138,7 +128,6 @@ test: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true test_pool_2_db_shard_d_replica: adapter: <%= adapter %> @@ -148,7 +137,6 @@ test: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true replica: true test_pool_2_db_d: @@ -159,7 +147,6 @@ test: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true test_pool_2_db_e: adapter: <%= adapter %> @@ -169,7 +156,6 @@ test: password: "<%= mysql.password %>" host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true test_pool_3_db_e: adapter: <%= adapter %> @@ -179,4 +165,3 @@ test: password: host: <%= mysql.host %> port: <%= mysql.port %> - reconnect: true