Commit 9a41378b authored by Shinya Maeda's avatar Shinya Maeda

Fix broken seeder 11.6

parent ec2c268b
...@@ -71,13 +71,18 @@ Sidekiq::Testing.inline! do ...@@ -71,13 +71,18 @@ Sidekiq::Testing.inline! do
params[:storage_version] = Project::LATEST_STORAGE_VERSION params[:storage_version] = Project::LATEST_STORAGE_VERSION
end end
project = nil
Sidekiq::Worker.skipping_transaction_check do
project = Projects::CreateService.new(User.first, params).execute project = Projects::CreateService.new(User.first, params).execute
end
# Seed-Fu runs this entire fixture in a transaction, so the `after_commit` # 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 # hook won't run until after the fixture is loaded. That is too late
# since the Sidekiq::Testing block has already exited. Force clearing # since the Sidekiq::Testing block has already exited. Force clearing
# the `after_commit` queue to ensure the job is run now. # the `after_commit` queue to ensure the job is run now.
Sidekiq::Worker.skipping_transaction_check do Sidekiq::Worker.skipping_transaction_check do
project.send(:_run_after_commit_queue) project.send(:_run_after_commit_queue)
project.import_state.send(:_run_after_commit_queue)
end end
if project.valid? && project.valid_repo? if project.valid? && project.valid_repo?
......
...@@ -25,7 +25,9 @@ Gitlab::Seeder.quiet do ...@@ -25,7 +25,9 @@ Gitlab::Seeder.quiet do
developer = project.team.developers.sample developer = project.team.developers.sample
break unless developer break unless developer
Sidekiq::Worker.skipping_transaction_check do
MergeRequests::CreateService.new(project, developer, params).execute MergeRequests::CreateService.new(project, developer, params).execute
end
print '.' print '.'
end end
end end
...@@ -39,7 +41,9 @@ Gitlab::Seeder.quiet do ...@@ -39,7 +41,9 @@ Gitlab::Seeder.quiet do
target_branch: 'master', target_branch: 'master',
title: 'Can be automatically merged' title: 'Can be automatically merged'
} }
Sidekiq::Worker.skipping_transaction_check do
MergeRequests::CreateService.new(project, User.admins.first, params).execute MergeRequests::CreateService.new(project, User.admins.first, params).execute
end
print '.' print '.'
params = { params = {
...@@ -47,6 +51,8 @@ Gitlab::Seeder.quiet do ...@@ -47,6 +51,8 @@ Gitlab::Seeder.quiet do
target_branch: 'feature', target_branch: 'feature',
title: 'Cannot be automatically merged' title: 'Cannot be automatically merged'
} }
Sidekiq::Worker.skipping_transaction_check do
MergeRequests::CreateService.new(project, User.admins.first, params).execute MergeRequests::CreateService.new(project, User.admins.first, params).execute
end
print '.' print '.'
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment