From d31cb463da59167906cc4cc119c6a939e9597e77 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Thu, 15 Jun 2023 14:55:48 -0400 Subject: [PATCH] Remove no connection primary key test This test was added in https://github.com/rails/rails/commit/b3407c86cfccd2cc6258b8879e91600fe25c6e48 at a time when Rails was reading the `primary_keys` off a hash stored on `connection`. We no longer do that in Active Record so this test isn't really necessary. I'm removing it because it was flaky. I attempted to fix it in #48473 but realized today it's not testing the same thing it was before. After discussing it with Matthew, I've decided to remove it. --- activerecord/test/cases/primary_keys_test.rb | 25 -------------------- 1 file changed, 25 deletions(-) diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index e336d983c1678..9ab1eb4724e9f 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -270,31 +270,6 @@ def test_serial_with_unquoted_sequence_name end end -class PrimaryKeyWithNoConnectionTest < ActiveRecord::TestCase - class NoConnection < ActiveRecord::Base - self.abstract_class = true - self.primary_key = "foo" - end - - self.use_transactional_tests = false - - unless in_memory_db? - def test_set_primary_key_with_no_connection - NoConnection.establish_connection :arunit - # execute to fully establish a connection - NoConnection.connection.execute("SELECT 1") - - assert NoConnection.connected? - assert_equal "foo", NoConnection.primary_key - - ActiveRecord::Base.connection_handler.remove_connection_pool("PrimaryKeyWithNoConnectionTest::NoConnection") - assert_nil NoConnection.connected? - - assert_equal "foo", NoConnection.primary_key - end - end -end - class PrimaryKeyWithAutoIncrementTest < ActiveRecord::TestCase self.use_transactional_tests = false