diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 18:44:49 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 18:44:49 +0000 |
commit | 15689ed7780b06ddc14cde4f427de834177283a5 (patch) | |
tree | bed64f4fdaf3e1a140642bdd0354384ae286759c /test/thread/test_sync.rb | |
parent | 967eab83e333430600926366621aa3a978701c6a (diff) |
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
Diffstat (limited to 'test/thread/test_sync.rb')
-rw-r--r-- | test/thread/test_sync.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/thread/test_sync.rb b/test/thread/test_sync.rb index e576fc1d32..8241445faf 100644 --- a/test/thread/test_sync.rb +++ b/test/thread/test_sync.rb @@ -52,11 +52,15 @@ class SyncTest < Test::Unit::TestCase tester= Tester.new tester.sync_lock(:EX) - t = Thread.new { tester.sync_lock(:EX) } + t = Thread.new { + assert_raise(RuntimeError) { + tester.sync_lock(:EX) + } + } sleep 0.1 until t.stop? t.raise - sleep 0.1 while t.alive? + t.join assert_equal(tester.sync_waiting.uniq, tester.sync_waiting) assert_equal(tester.sync_waiting, []) |