From 377948850fd820d6934c5c2d126bd53861956270 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 15 Dec 2017 12:33:59 +0900 Subject: [PATCH] Clear dirty `schema_cache` after `dump_schema_cache` `dump_schema_cache` fills `schema_cache` even if the test that modifies the schema has properly cleared the schema cache. Fixes #31463. --- activerecord/test/cases/tasks/database_tasks_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb index fd381f229f..c114842dec 100644 --- a/activerecord/test/cases/tasks/database_tasks_test.rb +++ b/activerecord/test/cases/tasks/database_tasks_test.rb @@ -110,6 +110,7 @@ module ActiveRecord ActiveRecord::Tasks::DatabaseTasks.dump_schema_cache(ActiveRecord::Base.connection, path) assert File.file?(path) ensure + ActiveRecord::Base.clear_cache! FileUtils.rm_rf(path) end end