mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
20ea127994
commit
30dcac0494
1 changed files with 4 additions and 1 deletions
|
@ -518,7 +518,10 @@ class TestQueue < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
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'
|
assert (consumers + producers).all?{|thr| thr.status =~ /\Arun|sleep\Z/}, 'no threads runnning'
|
||||||
|
|
||||||
# just exercising the concurrency of the support methods.
|
# just exercising the concurrency of the support methods.
|
||||||
|
|
Loading…
Reference in a new issue