summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/prepare_untracked_uploads.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-02-13 12:31:30 -0800
committerRémy Coutable <remy@rymai.me>2018-02-14 12:31:16 +0100
commit080dba4a7e036e4bcb9cae69c5de6bfa33ff8b2e (patch)
tree9a7b3906b01dc2b99c7cfa10ecd20a024e8aaa1e /lib/gitlab/background_migration/prepare_untracked_uploads.rb
parent1c91c4e3f7009d6e50ba046aff7b672a0f761d41 (diff)
downloadgitlab-ce-080dba4a7e036e4bcb9cae69c5de6bfa33ff8b2e.tar.gz
Avoid dropping tables in test
And use :migration tag to use deletion strategy, and to avoid caching tables, and to lock into a particular schema. Attempting to fix intermittent spec errors `PG::UndefinedTable: ERROR: relation "public.untracked_files_for_uploads" does not exist`.
Diffstat (limited to 'lib/gitlab/background_migration/prepare_untracked_uploads.rb')
-rw-r--r--lib/gitlab/background_migration/prepare_untracked_uploads.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration/prepare_untracked_uploads.rb b/lib/gitlab/background_migration/prepare_untracked_uploads.rb
index 298de005b9b..914a9e48a2f 100644
--- a/lib/gitlab/background_migration/prepare_untracked_uploads.rb
+++ b/lib/gitlab/background_migration/prepare_untracked_uploads.rb
@@ -171,8 +171,10 @@ module Gitlab
end
def drop_temp_table
- UntrackedFile.connection.drop_table(:untracked_files_for_uploads,
- if_exists: true)
+ unless Rails.env.test? # Dropping a table intermittently breaks test cleanup
+ UntrackedFile.connection.drop_table(:untracked_files_for_uploads,
+ if_exists: true)
+ end
end
end
end