Don't leak pipes. (#7820)

This commit is contained in:
Samuel Williams 2023-05-22 08:49:33 +09:00 committed by GitHub
parent 7f7a8fa555
commit 872249e209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-05-21 23:50:02 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>

View File

@ -212,10 +212,10 @@ class TestThreadQueue < Test::Unit::TestCase
total_count = 250
begin
assert_normal_exit(<<-"_eom", bug5343, timeout: timeout, chdir: d)
r, w = IO.pipe
#{total_count}.times do |i|
File.open("test_thr_kill_count", "w") {|f| f.puts i }
queue = Thread::Queue.new
r, w = IO.pipe
th = Thread.start {
queue.push(nil)
r.read 1