[DRE-commits] [ruby-mysql2] 01/01: Cleanup hanging rspec child on test failure
zeha at debian.org
zeha at debian.org
Fri Apr 10 14:45:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
zeha pushed a commit to branch master
in repository ruby-mysql2.
commit 7bda7b05e7e6041a2a7196a7ad9b55049cfc2cf2
Author: Christian Hofstaedtler <zeha at debian.org>
Date: Fri Apr 10 16:21:02 2015 +0200
Cleanup hanging rspec child on test failure
---
debian/patches/cleanup_fork.patch | 33 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 34 insertions(+)
diff --git a/debian/patches/cleanup_fork.patch b/debian/patches/cleanup_fork.patch
new file mode 100644
index 0000000..1132e51
--- /dev/null
+++ b/debian/patches/cleanup_fork.patch
@@ -0,0 +1,33 @@
+Description: Cleanup rspec child process on test failure
+Author: Christian Hofstaedtler <zeha at debian.org>
+Origin: vendor
+Forwarded: yes
+Bug: https://github.com/brianmario/mysql2/issues/611
+
+diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb
+index 533f239..97d1974 100644
+--- a/spec/mysql2/client_spec.rb
++++ b/spec/mysql2/client_spec.rb
+@@ -412,6 +412,7 @@ describe Mysql2::Client do
+ it "should run signal handlers while waiting for a response" do
+ mark = {}
+ trap(:USR1) { mark[:USR1] = Time.now }
++ pid = nil
+ begin
+ mark[:START] = Time.now
+ pid = fork do
+@@ -427,10 +428,12 @@ describe Mysql2::Client do
+ (mark[:END] - mark[:USR1]).should > 0.9
+ (mark[:END] - mark[:START]).should >= 2
+ (mark[:END] - mark[:START]).should < 2.3
+- Process.kill(:TERM, pid)
+- Process.waitpid2(pid)
+ ensure
+ trap(:USR1, 'DEFAULT')
++ if !pid.nil?
++ Process.kill(:TERM, pid)
++ Process.waitpid2(pid)
++ end
+ end
+ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 7893ddc..b80aeef 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ remove_rubygems_from_examples.patch
#deactivate_failing_specs.patch
avoid_openssl_loop.patch
correct_mysql_init.patch
+cleanup_fork.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-mysql2.git
More information about the Pkg-ruby-extras-commits
mailing list