From cf0fcbe7f6fd52b3455af99b61ef2c40e6a0062e Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 10 Dec 2017 11:58:41 +0900 Subject: 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 --- activerecord/test/cases/primary_keys_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test') 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 -- cgit v1.2.3