You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error:
PersistenceTest#test_reset_column_information_resets_children:
ActiveRecord::StatementInvalid: PG::ObjectNotInPrerequisiteState: ERROR: column "foo" in the middle of being added, try again later
: ALTER TABLE "topics" DROP COLUMN "foo"
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
/Users/alimi/repos/rails/activesupport/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/Users/alimi/repos/rails/activesupport/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/Users/alimi/repos/rails/activesupport/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
/Users/alimi/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
/Users/alimi/repos/rails/activesupport/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
/Users/alimi/repos/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb:603:in `remove_column'
/Users/alimi/repos/rails/activerecord/test/cases/persistence_test.rb:1261:in `ensure in test_reset_column_information_resets_children'
/Users/alimi/repos/rails/activerecord/test/cases/persistence_test.rb:1262:in `test_reset_column_information_resets_children'
bin/rails test Users/alimi/repos/rails/activerecord/test/cases/persistence_test.rb:1247
Add a ruby file to test/excludes that matches the name of the test class if one doesn't already exist. For example to exclude a test from ActiveRecord::AdapterTest, create test/excludes/ActiveRecord/AdapterTest.rb.
Add an exclude statement to the file with the name of the test to exclude and a description. For example to exclude test_indexes from ActiveRecord::AdapterTest:
exclude:test_indexes,"Rails transactional tests are being used while making schema changes. See https://www.cockroachlabs.com/docs/stable/online-schema-changes.html#limited-support-for-schema-changes-within-transactions."
Finally, if the test can run against CockroachDB with a few changes, add it to test/cases. Everything from the ActiveRecord test suite will be available, so a lot of the excluded test can be copied over. Namespace the test under the CockroachDB module to avoid name collisions. See test/cases/adapter_test.rb for an example.
See the Contributing Guide for instructions on running tests.
If the test isn't valid against CockroachDB
test/excludes
that matches the name of the test class if one doesn't already exist. For example to exclude a test fromActiveRecord::AdapterTest
, createtest/excludes/ActiveRecord/AdapterTest.rb
.test_indexes
fromActiveRecord::AdapterTest
:activerecord-cockroachdb-adapter/test/excludes/ActiveRecord/AdapterTest.rb
Line 1 in c3cb637
test/cases
. Everything from the ActiveRecord test suite will be available, so a lot of the excluded test can be copied over. Namespace the test under theCockroachDB
module to avoid name collisions. Seetest/cases/adapter_test.rb
for an example.See #48.
The text was updated successfully, but these errors were encountered: