diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index b95f837571..adef8a5292 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3742,4 +3742,21 @@ __END__ con.close end end if Socket.const_defined?(:MSG_OOB) + + def test_select_leak + assert_no_memory_leak([], <<-"end;", <<-"end;", rss: true, timeout: 60) + r, w = IO.pipe + rset = [r] + wset = [w] + Thread.new { IO.select(rset, wset, nil, 0) }.join + end; + 20_000.times do + th = Thread.new { IO.select(rset, wset) } + Thread.pass until th.stop? + th.kill + th.join + GC.start + end + end; + end end |