From d5014e393ad18134fd5f7585d0a0182c18c2d159 Mon Sep 17 00:00:00 2001 From: eregon Date: Tue, 12 Dec 2017 18:44:49 +0000 Subject: Fix test-all tests to avoid creating report_on_exception warnings * The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e [ky: this effectively reverts commit 01445af367ec ("test/test_ssl: prevent changing default internal encoding", 2017-11-26). This is OK since EnvUtil.with_default_internal has been made thread-safe.] Sync-with-trunk: r61188 --- test/test_ssl.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_ssl.rb b/test/test_ssl.rb index cfce1964..d84d162e 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -1259,13 +1259,15 @@ end ctx2.enable_fallback_scsv ctx2.max_version = OpenSSL::SSL::TLS1_1_VERSION s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) - t = Thread.new { s2.connect } - assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) { - s1.accept + t = Thread.new { + assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) { + s2.connect + } } assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) { - t.join + s1.accept } + t.join ensure sock1.close sock2.close -- cgit v1.2.3