summaryrefslogtreecommitdiff
path: root/test/openssl/test_pair.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 01:08:09 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 01:08:09 +0000
commit6d18cc288a6115751e96965dc56d56319b2868a8 (patch)
treefb1a78371d017bd7deff6f0ec458872e3508ecaa /test/openssl/test_pair.rb
parent853c346ddeb7fece492b772c99d4e3a33608dc78 (diff)
* test/openssl/test_pair.rb
(OpenSSL::TestPair#test_write_nonblock_no_exceptions): on some CIs such as Debian 6.0, Ubuntu 10.04, CentOS and vc10-x64 (maybe depend on OpenSSL version), writing to SSLSocket after SSL_ERROR_WANT_WRITE causes SSL_ERROR_SSL "bad write retry". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_pair.rb')
-rw-r--r--test/openssl/test_pair.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index e6b495f669..0087ef3078 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -206,12 +206,18 @@ class OpenSSL::TestPair < Test::Unit::TestCase
def test_write_nonblock_no_exceptions
ssl_pair {|s1, s2|
n = 0
- n += write_nonblock_no_ex s1, "a" * 100000
- n += write_nonblock_no_ex s1, "b" * 100000
- n += write_nonblock_no_ex s1, "c" * 100000
- n += write_nonblock_no_ex s1, "d" * 100000
- n += write_nonblock_no_ex s1, "e" * 100000
- n += write_nonblock_no_ex s1, "f" * 100000
+ begin
+ n += write_nonblock_no_ex s1, "a" * 100000
+ n += write_nonblock_no_ex s1, "b" * 100000
+ n += write_nonblock_no_ex s1, "c" * 100000
+ n += write_nonblock_no_ex s1, "d" * 100000
+ n += write_nonblock_no_ex s1, "e" * 100000
+ n += write_nonblock_no_ex s1, "f" * 100000
+ rescue OpenSSL::SSL::SSLError => e
+ # on some platforms (maybe depend on OpenSSL version), writing to
+ # SSLSocket after SSL_ERROR_WANT_WRITE causes this error.
+ raise e if n == 0
+ end
s1.close
assert_equal(n, s2.read.length)
}