From 8392f8186cd21f9190474bd6b5ac6ec58c7af96a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Mar 2011 06:11:10 +0000 Subject: test_middleware_unicorn: GC is aggressive! Oops, don't let GC close our listener before Unicorn can inherit it. --- test/test_middleware_unicorn.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_middleware_unicorn.rb b/test/test_middleware_unicorn.rb index 7949f78..0a506e5 100644 --- a/test/test_middleware_unicorn.rb +++ b/test/test_middleware_unicorn.rb @@ -6,9 +6,9 @@ class TestMiddlewareUnicorn < Test::Unit::TestCase def setup @host = ENV["UNICORN_TEST_ADDR"] || "127.0.0.1" - sock = TCPServer.new @host, 0 - @port = sock.addr[1] - ENV["UNICORN_FD"] = sock.fileno.to_s + @sock = TCPServer.new @host, 0 + @port = @sock.addr[1] + ENV["UNICORN_FD"] = @sock.fileno.to_s @host_with_port = "#@host:#@port" @opts = { :listeners => [ @host_with_port ] } @addr_regexp = Regexp.escape @host_with_port -- cgit v1.2.3-24-ge0c7