1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_thread.rb: flush before SystemStackError

* test/ruby/test_thread.rb (TestThread#test_stack_size): need to flush
  before SystemStackError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-21 07:35:47 +00:00
parent 3763c760fd
commit 2ed9c6fe0b

View file

@ -1,3 +1,4 @@
# -*- coding: us-ascii -*-
require 'test/unit'
require 'thread'
require_relative 'envutil'
@ -890,7 +891,7 @@ Thread.new(Thread.current) {|mth|
assert(h_default[:thread_machine_stack_size] <= h_large[:thread_machine_stack_size])
# check VM machine stack size
script = 'def rec; print "."; rec; end; rec'
script = 'def rec; print "."; STDOUT.flush; rec; end; rec'
size_default = invoke_rec script, nil, nil
assert(size_default > 0, size_default.to_s)
size_0 = invoke_rec script, 0, nil
@ -902,7 +903,7 @@ Thread.new(Thread.current) {|mth|
# check machine stack size
# Note that machine stack size may not change size (depend on OSs)
script = 'def rec; print "."; 1.times{1.times{1.times{rec}}}; end; Thread.new{rec}.join'
script = 'def rec; print "."; STDOUT.flush; 1.times{1.times{1.times{rec}}}; end; Thread.new{rec}.join'
vm_stack_size = 1024 * 1024
size_default = invoke_rec script, vm_stack_size, nil
size_0 = invoke_rec script, vm_stack_size, 0