1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix unstable test_serialized_attribute_works_under_concurrent_initial_access test

Since bd62389307, isolate test of `test_serialized_attribute_works_under_concurrent_initial_access` fails.

```
$ ./bin/test -w test/cases/serialized_attribute_test.rb -n test_serialized_attribute_works_under_concurrent_initial_access
Using sqlite3
Run options: -n test_serialized_attribute_works_under_concurrent_initial_access --seed 32129

# Running:

E

Error:
SerializedAttributeTest#test_serialized_attribute_works_under_concurrent_initial_access:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table:
```

If duplicate an unloaded model, it seems that method invocation for that class
is not guaranteed. Use the original class to avoid it.
This commit is contained in:
yuuji.yaginuma 2018-12-05 13:30:43 +09:00
parent 3a86599304
commit 65c4b1b50d

View file

@ -371,7 +371,7 @@ class SerializedAttributeTest < ActiveRecord::TestCase
end
def test_serialized_attribute_works_under_concurrent_initial_access
model = Topic.dup
model = ::Topic.dup
topic = model.last
topic.update group: "1"