diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 44f1cfafc9..5ed0ac4d54 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -493,8 +493,11 @@ class TestIO < Test::Unit::TestCase w.write "zz" src = StringIO.new("abcd") IO.copy_stream(src, w) - w.close + t = Thread.new { + w.close + } assert_equal("zzabcd", r.read) + t.join } end