diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-09-22 18:05:20 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-09-23 01:52:28 +0900 |
commit | 6c5e6b3ba0363ca496ea0b464edd1f2a235e8bf2 (patch) | |
tree | 53d6fad040dceb2c0b780e4ad137fd64006adcbd | |
parent | 6652ad7c639d71cec93c4d21030ff9020a4e9717 (diff) | |
download | ruby-openssl-6c5e6b3ba0363ca496ea0b464edd1f2a235e8bf2.tar.gz |
test/test_pair: replace sleep with IO.select
The sleep was to ensure that the SSLSocket#read_nonblock will get
close_notify alert. A simple IO.select will suffice.
-rw-r--r-- | test/test_pair.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb index 7daa9288..cbb985dd 100644 --- a/test/test_pair.rb +++ b/test/test_pair.rb @@ -218,7 +218,7 @@ module OpenSSL::TestPairM assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) } assert_equal("def\n", ret) s1.close - sleep 0.1 + IO.select([s2]) assert_raise(EOFError) { s2.read_nonblock(10) } } end @@ -234,7 +234,7 @@ module OpenSSL::TestPairM assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10, exception: false) } assert_equal("def\n", ret) s1.close - sleep 0.1 + IO.select([s2]) assert_equal(nil, s2.read_nonblock(10, exception: false)) } end |