Skip to content

Commit

Permalink
Improved test [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 8, 2024
1 parent cd1a1b5 commit f8a55e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/add_index_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_corruption
end
end

def test_lock_timeout
def test_remove_invalid_indexes
skip unless postgresql?

with_locked_table("users") do
Expand All @@ -109,6 +109,12 @@ def test_lock_timeout

StrongMigrations.stub(:remove_invalid_indexes, true) do
migrate AddIndexConcurrently

# fail if trying to add the same index in a future migration
error = assert_raises(ActiveRecord::StatementInvalid) do
migrate AddIndexConcurrently
end
assert_kind_of PG::DuplicateTable, error.cause
end

migrate AddIndexConcurrently, direction: :down
Expand Down

0 comments on commit f8a55e6

Please sign in to comment.