diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-06-30 09:44:15 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-06-30 11:45:38 +0900 |
commit | 8fe359086484cd322704e57fce25ef8c41d949a8 (patch) | |
tree | 38217dd6ad0e51ca8f08aa62033bf21268749b69 /test/ruby/test_thread_queue.rb | |
parent | 44eca1b22f96a3140d11d95f89948cbdae08daee (diff) |
Fixed ClosedQueueError by a timing issue
Diffstat (limited to 'test/ruby/test_thread_queue.rb')
-rw-r--r-- | test/ruby/test_thread_queue.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb index 4e34bb4f46..ccd51b7b31 100644 --- a/test/ruby/test_thread_queue.rb +++ b/test/ruby/test_thread_queue.rb @@ -331,11 +331,14 @@ class TestThreadQueue < Test::Unit::TestCase def test_sized_queue_one_closed_interrupt q = SizedQueue.new 1 q << :one - t1 = Thread.new { q << :two } + t1 = Thread.new { + Thread.current.report_on_exception = false + q << :two + } sleep 0.01 until t1.stop? q.close + assert_raise(ClosedQueueError) {t1.join} - t1.kill.join assert_equal 1, q.size assert_equal :one, q.pop assert q.empty?, "queue not empty" |