summaryrefslogtreecommitdiff
path: root/db/fixtures
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-12-06 15:25:07 +0900
committerShinya Maeda <shinya@gitlab.com>2018-12-06 15:25:07 +0900
commit9a41378bad735078b64d6ac5e205eed13bf0a98a (patch)
treecdf6e248252afc736f44a162d59c14c387b35841 /db/fixtures
parentec2c268b5ea51a11ded3dc87b034cca81b5090c4 (diff)
downloadgitlab-ce-9a41378bad735078b64d6ac5e205eed13bf0a98a.tar.gz
Fix broken seeder 11.6
Diffstat (limited to 'db/fixtures')
-rw-r--r--db/fixtures/development/04_project.rb7
-rw-r--r--db/fixtures/development/10_merge_requests.rb12
2 files changed, 15 insertions, 4 deletions
diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb
index 089de211380..41e2c4bfb1d 100644
--- a/db/fixtures/development/04_project.rb
+++ b/db/fixtures/development/04_project.rb
@@ -71,13 +71,18 @@ Sidekiq::Testing.inline! do
params[:storage_version] = Project::LATEST_STORAGE_VERSION
end
- project = Projects::CreateService.new(User.first, params).execute
+ project = nil
+ Sidekiq::Worker.skipping_transaction_check do
+ project = Projects::CreateService.new(User.first, params).execute
+ end
+
# Seed-Fu runs this entire fixture in a transaction, so the `after_commit`
# hook won't run until after the fixture is loaded. That is too late
# since the Sidekiq::Testing block has already exited. Force clearing
# the `after_commit` queue to ensure the job is run now.
Sidekiq::Worker.skipping_transaction_check do
project.send(:_run_after_commit_queue)
+ project.import_state.send(:_run_after_commit_queue)
end
if project.valid? && project.valid_repo?
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb
index bcfdd058a1c..8bdc7c6556c 100644
--- a/db/fixtures/development/10_merge_requests.rb
+++ b/db/fixtures/development/10_merge_requests.rb
@@ -25,7 +25,9 @@ Gitlab::Seeder.quiet do
developer = project.team.developers.sample
break unless developer
- MergeRequests::CreateService.new(project, developer, params).execute
+ Sidekiq::Worker.skipping_transaction_check do
+ MergeRequests::CreateService.new(project, developer, params).execute
+ end
print '.'
end
end
@@ -39,7 +41,9 @@ Gitlab::Seeder.quiet do
target_branch: 'master',
title: 'Can be automatically merged'
}
- MergeRequests::CreateService.new(project, User.admins.first, params).execute
+ Sidekiq::Worker.skipping_transaction_check do
+ MergeRequests::CreateService.new(project, User.admins.first, params).execute
+ end
print '.'
params = {
@@ -47,6 +51,8 @@ Gitlab::Seeder.quiet do
target_branch: 'feature',
title: 'Cannot be automatically merged'
}
- MergeRequests::CreateService.new(project, User.admins.first, params).execute
+ Sidekiq::Worker.skipping_transaction_check do
+ MergeRequests::CreateService.new(project, User.admins.first, params).execute
+ end
print '.'
end