aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/primary_keys_test.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-12-10 11:58:41 +0900
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2017-12-10 13:00:12 +0900
commitcf0fcbe7f6fd52b3455af99b61ef2c40e6a0062e (patch)
treebfe79dee0868f4a4d656d2a9bbfdb68ab9ac5d0d /activerecord/test/cases/primary_keys_test.rb
parent1b24fb213b820ebca29eb1d38efb07a410c7afaa (diff)
downloadrails-cf0fcbe7f6fd52b3455af99b61ef2c40e6a0062e.tar.gz
rails-cf0fcbe7f6fd52b3455af99b61ef2c40e6a0062e.tar.bz2
rails-cf0fcbe7f6fd52b3455af99b61ef2c40e6a0062e.zip
Reset schema cache after test
Currently, `test_copy_table_with_composite_primary_keys` test fails depending on execution order. The reproduction step is as follows. ``` $ ARCONN=sqlite3_mem bin/test -w -n "/^(?:CalculationsTest#(?:test_#skip_query_cache\\!_for_a_simple_calculation)|PrimaryKeyAnyTypeTest#(?:test_any_type_primary_key)|ActiveRecord::ConnectionAdapters::SQLite3AdapterTest#(?:test_copy_table_with_composite_primary_keys))$/" --seed 41545 ``` The column info is cached by `PrimaryKeyAnyTypeTest#test_any_type_primary_key`, and the test seems to have failed due to the influence. So clear cache after testing so as not to affect other tests. Related: https://travis-ci.org/rails/rails/jobs/313730163#L1788
Diffstat (limited to 'activerecord/test/cases/primary_keys_test.rb')
-rw-r--r--activerecord/test/cases/primary_keys_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb
index 7f6c2382ca..80016fc19d 100644
--- a/activerecord/test/cases/primary_keys_test.rb
+++ b/activerecord/test/cases/primary_keys_test.rb
@@ -298,6 +298,8 @@ class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase
assert_not column.null
assert_equal :string, column.type
assert_equal 42, column.limit
+ ensure
+ Barcode.reset_column_information
end
test "schema dump primary key includes type and options" do