diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-10 04:00:44 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-10 04:00:44 +0000 |
commit | 19e0d7c18ef614d65a279eaf427dea8786f659ac (patch) | |
tree | 1c95f552e42fca154b8e799a9d5cf481384d2bd9 /test/thread | |
parent | 235546ba049fe1e13517d075ec3ba9721af8cb54 (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/thread')
-rw-r--r-- | test/thread/test_queue.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index ec743772f8..993514f86d 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -85,7 +85,7 @@ class TestQueue < Test::Unit::TestCase 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 @@ class TestQueue < Test::Unit::TestCase r.read 1 } queue.pop - th.kill.join + th.kill + th.join end _eom rescue Timeout::Error |