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 assert_nil t1.value
t2 = Thread.new { q.push(2, timeout: 0.1) } 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 assert_nil t2.value
ensure ensure
t1&.kill t1&.kill&.join
t2&.kill t2&.kill&.join
end end
def test_sized_queue_push_interrupt def test_sized_queue_push_interrupt