diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 00:24:19 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 00:24:19 +0000 |
commit | 9fde038fa41c85e0f7728700fc80a67e19a1f68d (patch) | |
tree | f371ed85eb6bf5ea3e57431aaa8d3fef6a9a7b5e /test | |
parent | 6ee138021eff27a4977a51c2eed2eff10c7333c8 (diff) | |
download | ruby-9fde038fa41c85e0f7728700fc80a67e19a1f68d.tar.gz |
extend timeout limit.
* test/ruby/test_process.rb (test_threading_works_after_exec_fail):
extend timeout limit from 30 to 90 because some test nodes fails
with timeout error.
Also use a Queue instead of a local variable to communicate with
threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index ba46e94570..eb114dbebb 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2281,7 +2281,7 @@ EOS def test_threading_works_after_exec_fail r, w = IO.pipe pid = status = nil - Timeout.timeout(30) do + Timeout.timeout(90) do pid = fork do r.close begin @@ -2289,11 +2289,12 @@ EOS rescue SystemCallError w.syswrite("exec failed\n") end + q = Queue.new run = true - th1 = Thread.new { i = 0; i += 1 while run; i } - th2 = Thread.new { j = 0; j += 1 while run && Thread.pass.nil?; j } + th1 = Thread.new { i = 0; i += 1 while q.empty?; i } + th2 = Thread.new { j = 0; j += 1 while q.empty? && Thread.pass.nil?; j } sleep 0.5 - run = false + q << true w.syswrite "#{th1.value} #{th2.value}\n" end w.close |