Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-01-12 19:41:37 +0300
committerJacob Vosmaer <jacob@gitlab.com>2018-01-15 14:46:56 +0300
commit4aaf3dae1e1b8c07645095efb6d9028ff49b90bd (patch)
tree5df0b27cee310a47dc67304483c4e53d49062388 /spec/support
parentcc18608d24bc84fd7e51c256fb24325cb84ea9b5 (diff)
Use an at_exit hook to stop test gitaly
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/test_env.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 25ff6094408..fd6368e7b40 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -90,10 +90,6 @@ module TestEnv
setup_forked_repo
end
- def cleanup
- stop_gitaly
- end
-
def disable_mailer
allow_any_instance_of(NotificationService).to receive(:mailer)
.and_return(double.as_null_object)
@@ -163,6 +159,8 @@ module TestEnv
spawn_script = Rails.root.join('scripts/gitaly-test-spawn').to_s
@gitaly_pid = Bundler.with_original_env { IO.popen([spawn_script], &:read).to_i }
+ Kernel.at_exit { stop_gitaly }
+
wait_gitaly
end
@@ -309,7 +307,7 @@ module TestEnv
# Before we used Git clone's --mirror option, bare repos could end up
# with missing refs, clearing them and retrying should fix the issue.
- cleanup && clean_gitlab_test_path && init unless reset.call
+ clean_gitlab_test_path && init unless reset.call
end
end