From ba26f1f836e2ae9c9b5f0b54e55195e22016af3f Mon Sep 17 00:00:00 2001 From: eregon Date: Sun, 19 Nov 2017 15:15:49 +0000 Subject: [PATCH] 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 --- test/ruby/bug-13526.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/ruby/bug-13526.rb b/test/ruby/bug-13526.rb index f42e1913ce..e0b8e981cc 100644 --- a/test/ruby/bug-13526.rb +++ b/test/ruby/bug-13526.rb @@ -1,5 +1,7 @@ # From https://bugs.ruby-lang.org/issues/13526#note-1 +Thread.report_on_exception = true + sleep if $load $load = true @@ -7,7 +9,7 @@ n = 10 threads = Array.new(n) do Thread.new do begin - autoload :Foo, "#{File.dirname($0)}/#{$0}" + autoload :Foo, File.expand_path(__FILE__) Thread.pass Foo ensure @@ -17,4 +19,4 @@ threads = Array.new(n) do end Thread.pass while threads.all?(&:stop?) -100.times { Thread.pass } +1000.times { Thread.pass }