diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 09:25:37 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 09:25:37 +0000 |
commit | 072b3c862406a894e611175ecb48d1899c404228 (patch) | |
tree | e9d9b878cc90d2ed89930fbd89caf15ed4c2f7b5 | |
parent | 58ba24f8858ed4e9cae3dfe5aa8e62e0c6316878 (diff) |
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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | test/socket/test_unix.rb | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu Jun 18 18:24:12 2015 Eric Wong <[email protected]> + + * test/socket/test_unix.rb: replace sleep with select + Thu Jun 18 17:59:06 2015 Koichi Sasada <[email protected]> * vm.c (rb_vm_control_frame_id_and_class): remove usless codes. diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 344dcc90ad..9ca97d2998 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -388,7 +388,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase buf = "" s2.send("BBBBBB", 0) - sleep 0.1 + IO.select([s1]) rv = s1.recv(100, 0, buf) assert_equal buf.object_id, rv.object_id assert_equal "BBBBBB", rv |