summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 03:16:33 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 03:16:33 +0000
commit91dfb379eafe8a37755b6603301764e0212aa471 (patch)
treee02afc872450603adee311cbadab6d8e648ca955 /test
parentf8a38a36eba27f0e4a9f62f319496354e51bcc8f (diff)
add timeout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/thread/test_cv.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb
index 9f9e08e2ec3..49fee242499 100644
--- a/test/thread/test_cv.rb
+++ b/test/thread/test_cv.rb
@@ -74,8 +74,10 @@ class TestConditionVariable < Test::Unit::TestCase
condvar.broadcast
result << "P2"
end
- nr_threads.times do |i|
- threads[i].join
+ Timeout.timeout(5) do
+ nr_threads.times do |i|
+ threads[i].join
+ end
end
assert_equal ["C1", "C1", "C1", "P1", "P2", "C2", "C2", "C2"], result