From 8f31ccc91906fc4617fb74363f66605f5c69fda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 22 Mar 2013 10:09:09 +0100 Subject: [PATCH] Prevent random test failures. --- ruby-2.0.0-p57-test_thr_kill.patch | 49 ++++++++++++++++++++++++++++++ ruby.spec | 5 +++ 2 files changed, 54 insertions(+) create mode 100644 ruby-2.0.0-p57-test_thr_kill.patch diff --git a/ruby-2.0.0-p57-test_thr_kill.patch b/ruby-2.0.0-p57-test_thr_kill.patch new file mode 100644 index 0000000..c65ab23 --- /dev/null +++ b/ruby-2.0.0-p57-test_thr_kill.patch @@ -0,0 +1,49 @@ +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 39727) ++++ ChangeLog (revision 39728) +@@ -1,3 +1,15 @@ ++Tue Mar 12 00:56:19 2013 KOSAKI Motohiro ++ ++ * test/thread/test_queue.rb (TestQueue#test_thr_kill): reduce ++ iterations from 2000 to 250. When running on uniprocessor ++ systems, every th.kill needs TIME_QUANTUM_USEC time (i.e. ++ 100msec on posix systems). Because, "r.read 1" is 3 steps ++ operations that 1) release GVL 2) read 3) acquire gvl and ++ (1) invoke context switch to main thread. and then, main ++ thread's th.kill resume (1), but not (2). Thus read interrupt ++ need TIME_QUANTUM_USEC. Then maximum iteration is 30sec/100msec ++ = 300. ++ + Sun Feb 24 15:16:00 2013 Eric Hodel + + * lib/net/http.rb: Removed duplicate Accept-Encoding in Net::HTTP#get. +Index: test/thread/test_queue.rb +=================================================================== +--- test/thread/test_queue.rb (revision 39727) ++++ test/thread/test_queue.rb (revision 39728) +@@ -85,7 +85,7 @@ + bug5343 = '[ruby-core:39634]' + Dir.mktmpdir {|d| + timeout = 30 +- total_count = 2000 ++ total_count = 250 + begin + assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d}) + require "thread" +@@ -98,7 +98,8 @@ + r.read 1 + } + queue.pop +- th.kill.join ++ th.kill ++ th.join + end + _eom + rescue Timeout::Error + +Property changes on: . +___________________________________________________________________ +Modified: svn:mergeinfo + Merged /trunk:r39688 + diff --git a/ruby.spec b/ruby.spec index 40c3bcb..7830d3b 100644 --- a/ruby.spec +++ b/ruby.spec @@ -127,6 +127,9 @@ Patch14: rubygems-2.0.0-Fixes-for-empty-ruby-version.patch # Fixes issues with wrong value of Rubygem's shebang introduced in r39267. # https://bugs.ruby-lang.org/issues/7915 Patch15: ruby-2.0.0-revert-unexpand-exec-prefix.patch +# Fixes test_thr_kill(TestQueue) random test failure. +# https://bugs.ruby-lang.org/issues/7521 +Patch16: ruby-2.0.0-p57-test_thr_kill.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: ruby(rubygems) >= %{rubygems_version} @@ -390,6 +393,7 @@ Tcl/Tk interface for the object-oriented scripting language Ruby. %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p0 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -869,6 +873,7 @@ make check TESTS="-v $DISABLE_TESTS" %changelog * Thu Mar 21 2013 Vít Ondruch - 2.0.0.0-5 - Make Ruby buildable without rubypick. +- Prevent random test failures. * Fri Mar 08 2013 Mamoru TASAKA - 2.0.0.0-4 - Don't mark rpm config file as %%config (fpc#259)