diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_file.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 9462ae597b..974752c853 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -124,7 +124,7 @@ class TestFile < Test::Unit::TestCase q1 = Queue.new q2 = Queue.new - Thread.new do + th = Thread.new do data = '' 64.times do |i| data << i.to_s @@ -142,6 +142,7 @@ class TestFile < Test::Unit::TestCase assert_equal size, f.size q2.push true end + th.join end end diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 75657ab894..ccd5676171 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1237,8 +1237,9 @@ class TestProcess < Test::Unit::TestCase IO.pipe do |r, w| pid = spawn(RUBY, "foo", out: w) w.close - Thread.new { r.read(1); Process.kill(:SIGQUIT, pid) } + th = Thread.new { r.read(1); Process.kill(:SIGQUIT, pid) } Process.wait(pid) + th.join end t = Time.now s = $? |