diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-12-27 13:45:44 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-12-27 13:45:44 +0100 |
commit | 123bc1d5ebc102c75456b54cbce8f1ec1bfe0eff (patch) | |
tree | 5e64a55e8b09bb95bfbdf80d00c32fa0af5614b2 /spec/migrations | |
parent | 2f93259c6b3a1c543a6ea089f8e84257c7ab6ba5 (diff) | |
download | gitlab-ce-123bc1d5ebc102c75456b54cbce8f1ec1bfe0eff.tar.gz |
Fix rename projects spec so it doesn't hangdz-rename-reserved-project-names
This spec would hang due to the use of transactions, and would
incorrectly stub Thread.new.
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/rename_reserved_project_names_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/migrations/rename_reserved_project_names_spec.rb b/spec/migrations/rename_reserved_project_names_spec.rb index 66f68570b50..4fb7ed36884 100644 --- a/spec/migrations/rename_reserved_project_names_spec.rb +++ b/spec/migrations/rename_reserved_project_names_spec.rb @@ -3,14 +3,16 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20161221153951_rename_reserved_project_names.rb') -describe RenameReservedProjectNames do +# This migration uses multiple threads, and thus different transactions. This +# means data created in this spec may not be visible to some threads. To work +# around this we use the TRUNCATE cleaning strategy. +describe RenameReservedProjectNames, truncate: true do let(:migration) { described_class.new } - let!(:project) { create(:project) } + let!(:project) { create(:empty_project) } before do project.path = 'projects' project.save!(validate: false) - allow(Thread).to receive(:new).and_yield end describe '#up' do |