summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 21:22:46 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 21:22:46 +0000
commit84ccd55abd97f3bc9588bf71c0cfc9cfdf1003d4 (patch)
treedf412b3b14adaf8cb0eb5c7a08003ef6b5c09949 /test
parent63818379aa3c88681daf634c5f55b2cffac68283 (diff)
merge revision(s) 57595: [Backport #8996]
check thread deadness correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_thread.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 97643947ad..c1f03c7868 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1104,4 +1104,14 @@ q.pop
c = Class.new(Thread) {def initialize() self.name = "foo"; super; end}
assert_equal("foo", c.new {Thread.current.name}.value)
end
+
+ def test_thread_interrupt_for_killed_thread
+ assert_normal_exit(<<-_end, '[Bug #8996]', timeout: 5, timeout_error: nil)
+ trap(:TERM){exit}
+ while true
+ t = Thread.new{sleep 0}
+ t.raise Interrupt
+ end
+ _end
+ end
end