summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-09-12 02:49:32 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-09-12 02:49:32 +0800
commit82f18eabf3cf5d035508fb23c3f7072f9c7d9a41 (patch)
treede78f4130306e57bd554c4bf281200f3b6ef8102
parent73a913f2b5f2a5dd36e13e09d74264d1da218d6a (diff)
downloadgitlab-ce-37608-reset-all-connections.tar.gz
Reset all connection schema cache after migration tests37608-reset-all-connections
We might also want to consider reduce the number of connections in the tests. However I just tried setting it to 1 and that doesn't seem enough for feature tests.
-rw-r--r--spec/support/migrations_helpers.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/migrations_helpers.rb b/spec/support/migrations_helpers.rb
index 4ca019c1b05..6522d74ba89 100644
--- a/spec/support/migrations_helpers.rb
+++ b/spec/support/migrations_helpers.rb
@@ -16,7 +16,9 @@ module MigrationsHelpers
end
def reset_column_in_migration_models
- ActiveRecord::Base.clear_cache!
+ ActiveRecord::Base.connection_pool.connections.each do |conn|
+ conn.schema_cache.clear!
+ end
described_class.constants.sort.each do |name|
const = described_class.const_get(name)