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
When running tests in parallel, a new database is created for each test
worker (via `ActiveRecord::TestDatabases.create_and_load_schema`). Each
of these databases use different OID numbers for custom defined types
such as enums. If model schemas are loaded before forking -- as done in
`railties/lib/rails/testing/maintain_test_schema.rb` when `eager_load`
is true -- Rails will hold on to the OID numbers from the original
database. Thus each test worker does not recognize the OID numbers when
resolving model attribute types.
This commit sidesteps the problem by resolving model attribute types on
schema load. This does not address the conflicting OID numbers, but
each test worker will inherit properly resolved attribute types.
Fixesrails#52607.
0 commit comments