From 4f7d32311e6500eac52fee1aedd4aca18d73fce5 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 13 Jun 2019 22:02:38 +0900 Subject: Avoid implicit rollback when testing migration "schema_migrations" is hard dropped by some existing tests, so testing migration in using transactional tests may cause implicit creation and rollback "schema_migrations" table, it makes migration tests flaky. https://buildkite.com/rails/rails/builds/61692#42383249-30be-4508-b1fb-a7bb27600c8e/999-1010 https://buildkite.com/rails/rails/builds/61694#6e462ad3-41d8-4e26-95ce-728495b0ac64/999-1010 --- activerecord/test/cases/adapters/postgresql/uuid_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb index d2d8ea8042..fe69b82764 100644 --- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb +++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb @@ -283,6 +283,7 @@ class PostgresqlUUIDGenerationTest < ActiveRecord::PostgreSQLTestCase end end + uses_transaction \ def test_schema_dumper_for_uuid_primary_key_default_in_legacy_migration @verbose_was = ActiveRecord::Migration.verbose ActiveRecord::Migration.verbose = false @@ -331,6 +332,7 @@ class PostgresqlUUIDTestNilDefault < ActiveRecord::PostgreSQLTestCase assert_match(/\bcreate_table "pg_uuids", id: :uuid, default: nil/, schema) end + uses_transaction \ def test_schema_dumper_for_uuid_primary_key_with_default_nil_in_legacy_migration @verbose_was = ActiveRecord::Migration.verbose ActiveRecord::Migration.verbose = false -- cgit v1.2.3