diff --git a/common.mk b/common.mk index ab151d0f8c30ee..6dea9a5651c378 100644 --- a/common.mk +++ b/common.mk @@ -929,7 +929,7 @@ test-sample: test-basic # backward compatibility for mswin-build test-short: btest-ruby $(DOT_WAIT) test-knownbug $(DOT_WAIT) test-basic test: test-short -yes-test-all-precheck: programs encs exts PHONY $(DOT_WAIT) +yes-test-all-precheck: programs PHONY $(DOT_WAIT) # $ make test-all TESTOPTS="--help" displays more detail # for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name" diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index d7ae6133bed86c..3126a73744987a 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -16,10 +16,14 @@ def self.new(*) end def setup + STDERR.puts "\n\n!!! setup #{self.instance_variable_get(:@__name__)}" + Thread::Threads.clear end def teardown + STDERR.puts "\n\n!!! teardown #{self.instance_variable_get(:@__name__)}" + Thread::Threads.each do |t| t.kill if t.alive? begin @@ -84,41 +88,6 @@ def obj.hash assert(obj[:visited], "obj.hash was not called") end - def test_handle_interrupt_invalid_argument - assert_raise(ArgumentError) { - Thread.handle_interrupt(RuntimeError => :immediate) # no block - } - assert_raise(ArgumentError) { - Thread.handle_interrupt(RuntimeError => :xyzzy) {} - } - assert_raise(TypeError) { - Thread.handle_interrupt([]) {} # array - } - end - - def test_handle_interrupt_blocking - r = nil - q = Thread::Queue.new - e = Class.new(Exception) - th_s = Thread.current - th = Thread.start { - assert_raise(RuntimeError) { - Thread.handle_interrupt(Object => :on_blocking){ - begin - q.pop - Thread.current.raise RuntimeError, "will raise in sleep" - r = :ok - sleep - ensure - th_s.raise e, "raise from ensure", $@ - end - } - } - } - assert_raise(e) {q << true; th.join} - assert_equal(:ok, r) - end - def invoke_rec script, vm_stack_size, machine_stack_size, use_length = true env = {} env['RUBY_THREAD_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size