ruby-changes:44719
From: headius <ko1@a...>
Date: Tue, 15 Nov 2016 04:39:26 +0900 (JST)
Subject: [ruby-changes:44719] headius:r56792 (trunk): * test/thread/test_queue.rb: Give up to ten seconds for threads to
headius 2016-11-15 04:39:21 +0900 (Tue, 15 Nov 2016) New Revision: 56792 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56792 Log: * test/thread/test_queue.rb: Give up to ten seconds for threads to reach expected state before proceeding. Modified files: trunk/test/thread/test_queue.rb Index: test/thread/test_queue.rb =================================================================== --- test/thread/test_queue.rb (revision 56791) +++ test/thread/test_queue.rb (revision 56792) @@ -518,7 +518,10 @@ class TestQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/thread/test_queue.rb#L518 end end - # No dead or finished threads + # No dead or finished threads, give up to 10 seconds to start running + t = Time.now + Thread.pass until Time.now - t > 10 || (consumers + producers).all?{|thr| thr.status =~ /\Arun|sleep\Z/} + assert (consumers + producers).all?{|thr| thr.status =~ /\Arun|sleep\Z/}, 'no threads runnning' # just exercising the concurrency of the support methods. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/