rf-web/vendor/bundle/gems/eventmachine-1.2.7/tests/test_many_fds.rb

23 lines
462 B
Ruby
Raw Normal View History

2019-10-21 08:18:17 +00:00
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