ruby-changes:56287
From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Jun 2019 18:53:49 +0900 (JST)
Subject: [ruby-changes:56287] Nobuyoshi Nakada: 8fe3590864 (trunk): Fixed ClosedQueueError by a timing issue
https://git.ruby-lang.org/ruby.git/commit/?id=8fe3590864 From 8fe359086484cd322704e57fce25ef8c41d949a8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 30 Jun 2019 09:44:15 +0900 Subject: Fixed ClosedQueueError by a timing issue diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb index 4e34bb4..ccd51b7 100644 --- a/test/ruby/test_thread_queue.rb +++ b/test/ruby/test_thread_queue.rb @@ -331,11 +331,14 @@ class TestThreadQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread_queue.rb#L331 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" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/