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

Wait testing/helper threads to terminate

This commit is contained in:
Nobuyoshi Nakada 2020-12-13 13:39:57 +09:00
parent 416e402cf3
commit c7530f0d56
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
3 changed files with 7 additions and 7 deletions

View file

@ -33,7 +33,7 @@ module Net
end
def teardown
@server_thread&.exit
@server_thread&.exit&.join
@server_socket&.close
@client_socket&.close
end

View file

@ -19,7 +19,7 @@ module Net
end
def teardown
@server_thread&.exit
@server_thread&.exit&.join
@server_socket&.close
@client_socket&.close
end

View file

@ -230,9 +230,9 @@ class TestThread < Test::Unit::TestCase
assert_equal(t1, t3.value)
ensure
t1&.kill
t2&.kill
t3&.kill
t1&.kill&.join
t2&.kill&.join
t3&.kill&.join
end
{ 'FIXNUM_MAX' => RbConfig::LIMITS['FIXNUM_MAX'],
@ -630,7 +630,7 @@ class TestThread < Test::Unit::TestCase
Thread.pass until t.stop?
assert_predicate(t, :alive?)
ensure
t&.kill
t&.kill&.join
end
def test_mutex_deadlock
@ -1119,7 +1119,7 @@ q.pop
Thread.pass until mutex.locked?
assert_equal(mutex.owned?, false)
ensure
th&.kill
th&.kill&.join
end
end