diff options
Diffstat (limited to 'test/socket/test_tcp.rb')
-rw-r--r-- | test/socket/test_tcp.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb index e059621985..8d55c011cf 100644 --- a/test/socket/test_tcp.rb +++ b/test/socket/test_tcp.rb @@ -7,17 +7,22 @@ end class TestTCPSocket < Test::Unit::TestCase def test_recvfrom # [ruby-dev:24705] + c = s = nil svr = TCPServer.new("localhost", 0) Thread.new { - svr.accept.print("x"*0x1000) + c = svr.accept + Thread.pass until s + c.print("x"*0x1000) } addr = svr.addr sock = TCPSocket.open(addr[2], addr[1]) Thread.new { - Thread.pass + Thread.pass until c + Thread.critical = true ObjectSpace.each_object(String) {|s| - s.replace "a" if s.length == 0x10000 + s.replace "a" if s.length == 0x10000 and !s.frozen? } + Thread.critical = false } assert_raise(RuntimeError, SocketError) { sock.recvfrom(0x10000) |