зеркало из https://github.com/github/ruby.git
test/ruby/bug-13526.rb: Fix to actually refer to an existing file
* Add Thread.report_on_exception=true to catch problems early. * Increase the number of Thread.pass to let the autoload start. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
764c8bb4d1
Коммит
ba26f1f836
|
@ -1,5 +1,7 @@
|
||||||
# From https://bugs.ruby-lang.org/issues/13526#note-1
|
# From https://bugs.ruby-lang.org/issues/13526#note-1
|
||||||
|
|
||||||
|
Thread.report_on_exception = true
|
||||||
|
|
||||||
sleep if $load
|
sleep if $load
|
||||||
$load = true
|
$load = true
|
||||||
|
|
||||||
|
@ -7,7 +9,7 @@ n = 10
|
||||||
threads = Array.new(n) do
|
threads = Array.new(n) do
|
||||||
Thread.new do
|
Thread.new do
|
||||||
begin
|
begin
|
||||||
autoload :Foo, "#{File.dirname($0)}/#{$0}"
|
autoload :Foo, File.expand_path(__FILE__)
|
||||||
Thread.pass
|
Thread.pass
|
||||||
Foo
|
Foo
|
||||||
ensure
|
ensure
|
||||||
|
@ -17,4 +19,4 @@ threads = Array.new(n) do
|
||||||
end
|
end
|
||||||
|
|
||||||
Thread.pass while threads.all?(&:stop?)
|
Thread.pass while threads.all?(&:stop?)
|
||||||
100.times { Thread.pass }
|
1000.times { Thread.pass }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче