1 require_relative 'helper'
3 class TestEpollGC < Test::Unit::TestCase
7 GC.stress = true if GC.respond_to?(:stress=)
12 GC.stress = false if GC.respond_to?(:stress=)
15 def add_pipe_no_tailcall(m, depth)
16 add_pipe(m, depth += 1)
19 def add_pipe(m, depth = 0)
22 warn "wr: #{wr.fileno}"
23 @ep.__send__(m, wr, Epoll::OUT)
25 add_pipe_no_tailcall(m, depth + 1)
34 @ep.wait(nil, 10) { |flags, obj| p [ flags, x = obj ] }
35 assert x, "#{x.inspect}"
39 2048.times { IO.pipe; File.open(__FILE__)}
42 rescue Errno::EMFILE, Errno::ENFILE
43 Thread.new { GC.start }.join
46 end if ENV["GC_STRESS"].to_i != 0