Skip to content

Commit b48d2b2

Browse files
committed
Address test_disable_extension_with_schema failure
This commit addresses the following failure. ``` $ ARCONN=postgresql bin/test test/cases/adapters/postgresql/extension_migration_test.rb test/cases/adapters/postgresql/postgresql_adapter_test.rb -n "/^(?:PostgresqlExtensionMigrationTest#(?:test_disable_extension_raises_when_dependent_objects_exist)|ActiveRecord::ConnectionAdapters::PostgreSQLAdapterTest#(?:test_disable_extension_with_schema))$/" --seed 3841 -v Using postgresql Run options: -n "/^(?:PostgresqlExtensionMigrationTest#(?:test_disable_extension_raises_when_dependent_objects_exist)|ActiveRecord::ConnectionAdapters::PostgreSQLAdapterTest#(?:test_disable_extension_with_schema))$/" --seed 3841 -v PostgresqlExtensionMigrationTest#test_disable_extension_raises_when_dependent_objects_exist = 0.05 s = . ActiveRecord::ConnectionAdapters::PostgreSQLAdapterTest#test_disable_extension_with_schema = 0.02 s = F Failure: ActiveRecord::ConnectionAdapters::PostgreSQLAdapterTest#test_disable_extension_with_schema [test/cases/adapters/postgresql/postgresql_adapter_test.rb:676]: Expected: [["hstore"]] Actual: [] bin/test test/cases/adapters/postgresql/postgresql_adapter_test.rb:672 Finished in 0.070507s, 28.3659 runs/s, 56.7318 assertions/s. 2 runs, 4 assertions, 1 failures, 0 errors, 0 skips ``` Applied the same change for `test_disable_extension_without_schema` Follow up rails#52528 Refer to rails#52452 (comment)
1 parent a63bef5 commit b48d2b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ def test_date_decoding_disabled
671671

672672
def test_disable_extension_with_schema
673673
@connection.execute("CREATE SCHEMA custom_schema")
674-
@connection.execute("CREATE EXTENSION IF NOT EXISTS hstore SCHEMA custom_schema")
674+
@connection.execute("DROP EXTENSION IF EXISTS hstore")
675+
@connection.execute("CREATE EXTENSION hstore SCHEMA custom_schema")
675676
result = @connection.query("SELECT extname FROM pg_extension WHERE extnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'custom_schema')")
676677
assert_equal [["hstore"]], result.to_a
677678

@@ -684,7 +685,8 @@ def test_disable_extension_with_schema
684685
end
685686

686687
def test_disable_extension_without_schema
687-
@connection.execute("CREATE EXTENSION IF NOT EXISTS hstore")
688+
@connection.execute("DROP EXTENSION IF EXISTS hstore")
689+
@connection.execute("CREATE EXTENSION hstore")
688690
result = @connection.query("SELECT extname FROM pg_extension")
689691
assert_includes result.to_a, ["hstore"]
690692

0 commit comments

Comments
 (0)