mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/socket/test_tcp.rb (TestTCPSocket#test_recvfrom): merged worker threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
25a637eff5
commit
ec8d7f3672
1 changed files with 3 additions and 9 deletions
|
@ -11,19 +11,13 @@ class TestTCPSocket < Test::Unit::TestCase
|
|||
svr = TCPServer.new("localhost", 0)
|
||||
Thread.new {
|
||||
c = svr.accept
|
||||
Thread.pass until s
|
||||
ObjectSpace.each_object(String) {|s|
|
||||
s.replace "a" if s.length == 0x10000 and !s.frozen?
|
||||
}
|
||||
c.print("x"*0x1000)
|
||||
}
|
||||
addr = svr.addr
|
||||
sock = TCPSocket.open(addr[2], addr[1])
|
||||
Thread.new {
|
||||
Thread.pass until c
|
||||
Thread.critical = true
|
||||
ObjectSpace.each_object(String) {|s|
|
||||
s.replace "a" if s.length == 0x10000 and !s.frozen?
|
||||
}
|
||||
Thread.critical = false
|
||||
}
|
||||
assert_raise(RuntimeError, SocketError) {
|
||||
sock.recvfrom(0x10000)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue