aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorheadius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 19:39:21 +0000
committerheadius <headius@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 19:39:21 +0000
commitabf87c74ed1283a10be5eaa9f1caa4131ccbf799 (patch)
treec5b3c5e45a9cfacd19e4237bfbd654679add7927
parent7093b7aac0ece899e25826f4d973a2e0ec37e748 (diff)
downloadruby-abf87c74ed1283a10be5eaa9f1caa4131ccbf799.tar.gz
* test/thread/test_queue.rb: Give up to ten seconds for threads to
reach expected state before proceeding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/thread/test_queue.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index f441f19d17..a20120fd71 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -518,7 +518,10 @@ class TestQueue < Test::Unit::TestCase
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.