1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Harden SizedQueue#push timeout test

This commit is contained in:
Nobuyoshi Nakada 2022-08-19 00:16:44 +09:00
parent 7c1ed47097
commit 2652b0da6b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -179,11 +179,11 @@ class TestThreadQueue < Test::Unit::TestCase
assert_nil t1.value
t2 = Thread.new { q.push(2, timeout: 0.1) }
assert_equal t2, t2.join(0.2)
assert_equal t2, t2.join(1)
assert_nil t2.value
ensure
t1&.kill
t2&.kill
t1&.kill&.join
t2&.kill&.join
end
def test_sized_queue_push_interrupt