From 01fe901e47895df923235b66d7e8ce0f2341ee2b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 5 Oct 2015 09:59:02 -0700 Subject: Fixes GDK issue where repos would not be imported properly 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. See: gitlab-org/gitlab-development-kit#58 --- db/fixtures/development/04_project.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'db/fixtures/development/04_project.rb') diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index 8f71198e47f..973b3f278f9 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -73,6 +73,11 @@ Sidekiq::Testing.inline! do } project = Projects::CreateService.new(User.first, params).execute + # 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. + project.send(:_run_after_commit_queue) if project.valid? print '.' -- cgit v1.2.1