rf-web/vendor/bundle/gems/eventmachine-1.2.7/tests/test_many_fds.rb
2019-10-21 10:18:17 +02:00

23 lines
462 B
Ruby

require 'em_test_helper'
require 'socket'
class TestManyFDs < Test::Unit::TestCase
def setup
@port = next_port
end
def test_connection_class_cache
mod = Module.new
a = nil
Process.setrlimit(Process::RLIMIT_NOFILE, 4096) rescue nil
EM.run {
EM.start_server '127.0.0.1', @port, mod
1100.times do
a = EM.connect '127.0.0.1', @port, mod
assert_kind_of EM::Connection, a
end
EM.stop
}
end
end