1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/socket/test_unix.rb: replace sleep with select

Not sure what drugs I was on, but blindly sleeping instead of
using IO#wait or IO.select to wait for data on a socket is
completely wrong.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2015-06-18 09:25:37 +00:00
parent 58ba24f885
commit 072b3c8624
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Thu Jun 18 18:24:12 2015 Eric Wong <e@80x24.org>
* test/socket/test_unix.rb: replace sleep with select
Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net> Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net>
* vm.c (rb_vm_control_frame_id_and_class): remove usless codes. * vm.c (rb_vm_control_frame_id_and_class): remove usless codes.

View file

@ -388,7 +388,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
buf = "" buf = ""
s2.send("BBBBBB", 0) s2.send("BBBBBB", 0)
sleep 0.1 IO.select([s1])
rv = s1.recv(100, 0, buf) rv = s1.recv(100, 0, buf)
assert_equal buf.object_id, rv.object_id assert_equal buf.object_id, rv.object_id
assert_equal "BBBBBB", rv assert_equal "BBBBBB", rv