From 65c4b1b50df3fa59198de2d45d1f54b61ecc7864 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 5 Dec 2018 13:30:43 +0900 Subject: [PATCH] Fix unstable `test_serialized_attribute_works_under_concurrent_initial_access` test Since bd62389307e138ee0f274a9d62697567a3334ea0, 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. --- activerecord/test/cases/serialized_attribute_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/test/cases/serialized_attribute_test.rb b/activerecord/test/cases/serialized_attribute_test.rb index 08ab4dc600..f6cd4f85ee 100644 --- a/activerecord/test/cases/serialized_attribute_test.rb +++ b/activerecord/test/cases/serialized_attribute_test.rb @@ -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"