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:
parent
416e402cf3
commit
c7530f0d56
3 changed files with 7 additions and 7 deletions
|
@ -33,7 +33,7 @@ module Net
|
|||
end
|
||||
|
||||
def teardown
|
||||
@server_thread&.exit
|
||||
@server_thread&.exit&.join
|
||||
@server_socket&.close
|
||||
@client_socket&.close
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ module Net
|
|||
end
|
||||
|
||||
def teardown
|
||||
@server_thread&.exit
|
||||
@server_thread&.exit&.join
|
||||
@server_socket&.close
|
||||
@client_socket&.close
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue