77class TestDir < Test ::Unit ::TestCase
88
99 def setup
10+ omit "lots of Dir.chdir" if multiple_ractors?
1011 @verbose = $VERBOSE
1112 @root = File . realpath ( Dir . mktmpdir ( '__test_dir__' ) )
1213 @nodir = File . join ( @root , "dummy" )
@@ -23,6 +24,7 @@ def setup
2324 end
2425
2526 def teardown
27+ return if multiple_ractors?
2628 $VERBOSE = @verbose
2729 FileUtils . remove_entry_secure @root if File . directory? ( @root )
2830 ENV . update ( @envs ) if @envs
@@ -97,7 +99,7 @@ def test_rewind
9799 end
98100
99101 def test_class_chdir
100- omit "not ractor safe " unless main_ractor?
102+ omit "Dir.chdir " unless main_ractor?
101103 pwd = Dir . pwd
102104 setup_envs
103105
@@ -137,7 +139,7 @@ def test_class_chdir
137139 end
138140
139141 def test_instance_chdir
140- omit "not ractor safe " unless main_ractor?
142+ omit "Dir.chdir " unless main_ractor?
141143 pwd = Dir . pwd
142144 dir = Dir . new ( pwd )
143145 root_dir = Dir . new ( @root )
@@ -205,7 +207,7 @@ def Warning.warn(message)
205207 end
206208
207209 def test_chdir_conflict
208- omit "not ractor safe " unless main_ractor?
210+ omit "Dir.chdir " unless main_ractor?
209211 pwd = Dir . pwd
210212 q = Thread ::Queue . new
211213 t = Thread . new do
@@ -282,7 +284,7 @@ def test_glob
282284 end
283285
284286 def test_glob_recursive
285- omit "not ractor safe " unless main_ractor?
287+ omit "Dir.chdir " unless main_ractor?
286288 bug6977 = '[ruby-core:47418]'
287289 bug8006 = '[ruby-core:53108] [Bug #8006]'
288290 Dir . chdir ( @root ) do
@@ -312,7 +314,7 @@ def test_glob_recursive
312314 end
313315
314316 def test_glob_recursive_directory
315- omit "not ractor safe " unless main_ractor?
317+ omit "Dir.chdir " unless main_ractor?
316318 Dir . chdir ( @root ) do
317319 [ 'd' , 'e' ] . each do |path |
318320 FileUtils . mkdir_p ( "c/#{ path } /a/b/c" )
@@ -330,7 +332,7 @@ def test_glob_recursive_directory
330332 end
331333
332334 def test_glob_starts_with_brace
333- omit "not ractor safe " unless main_ractor?
335+ omit "Dir.chdir " unless main_ractor?
334336 Dir . chdir ( @root ) do
335337 bug15649 = '[ruby-core:91728] [Bug #15649]'
336338 assert_equal ( [ "#{ @root } /a" , "#{ @root } /b" ] ,
@@ -339,7 +341,7 @@ def test_glob_starts_with_brace
339341 end
340342
341343 def test_glob_recursive_with_brace
342- omit "not ractor safe " unless main_ractor?
344+ omit "Dir.chdir " unless main_ractor?
343345 Dir . chdir ( @root ) do
344346 bug19042 = '[ruby-core:110220] [Bug #19042]'
345347 %w" c/dir_a c/dir_b c/dir_b/dir " . each do |d |
@@ -354,7 +356,7 @@ def test_glob_recursive_with_brace
354356 end
355357
356358 def test_glob_order
357- omit "not ractor safe " unless main_ractor?
359+ omit "Dir.chdir " unless main_ractor?
358360 Dir . chdir ( @root ) do
359361 assert_equal ( [ "#{ @root } /a" , "#{ @root } /b" ] , Dir . glob ( "#{ @root } /[ba]" ) )
360362 assert_equal ( [ "#{ @root } /b" , "#{ @root } /a" ] , Dir . glob ( %W" #{ @root } /b #{ @root } /a" ) )
@@ -384,7 +386,7 @@ def test_glob_too_may_open_files
384386 end
385387
386388 def test_glob_base
387- omit "not ractor safe ( Dir.chdir) " unless main_ractor?
389+ omit "Dir.chdir" unless main_ractor?
388390 files = %w[ a/foo.c c/bar.c ]
389391 files . each { |n | File . write ( File . join ( @root , n ) , "" ) }
390392 Dir . mkdir ( File . join ( @root , "a/dir" ) )
@@ -425,7 +427,7 @@ def test_glob_base
425427 end
426428
427429 def test_glob_base_dir
428- omit "not ractor safe " unless main_ractor?
430+ omit "Dir.chdir " unless main_ractor?
429431 files = %w[ a/foo.c c/bar.c ]
430432 files . each { |n | File . write ( File . join ( @root , n ) , "" ) }
431433 Dir . mkdir ( File . join ( @root , "a/dir" ) )
@@ -448,7 +450,7 @@ def test_glob_base_dir
448450 end
449451
450452 def test_glob_ignore_casefold_invalid_encoding
451- omit "not ractor safe " unless main_ractor?
453+ omit "Dir.chdir " unless main_ractor?
452454 bug14456 = "[ruby-core:85448]"
453455 filename = "\u00AA a123" . encode ( 'ISO-8859-1' )
454456 File . write ( File . join ( @root , filename ) , "" )
@@ -566,7 +568,7 @@ def test_glob_metachar
566568 end
567569
568570 def test_glob_cases
569- omit "not ractor safe ( Dir.chdir) " unless main_ractor?
571+ omit "Dir.chdir" unless main_ractor?
570572 feature5994 = "[ruby-core:42469] [Feature #5994]"
571573 feature5994 << "\n Dir.glob should return the filename with actual cases on the filesystem"
572574 Dir . chdir ( File . join ( @root , "a" ) ) do
@@ -732,7 +734,7 @@ def test_fileno
732734 end
733735
734736 def test_for_fd
735- omit "not ractor safe " unless main_ractor?
737+ omit "Dir.chdir " unless main_ractor?
736738 if Dir . respond_to? :for_fd
737739 begin
738740 new_dir = Dir . new ( '..' )
0 commit comments