Skip to content

Instantly share code, notes, and snippets.

@nagachika
Created January 6, 2012 17:29
Show Gist options
  • Save nagachika/1571568 to your computer and use it in GitHub Desktop.
Save nagachika/1571568 to your computer and use it in GitHub Desktop.
patch for test_autoclose
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 76eb82c..0fbec35 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1409,13 +1409,15 @@ class TestIO < Test::Unit::TestCase
end
def try_fdopen(fd, autoclose = true, level = 100)
- if level > 0
- try_fdopen(fd, autoclose, level - 1)
- GC.start
- level
- else
- IO.for_fd(fd, autoclose: autoclose)
- nil
+ 1.times do
+ if level > 0
+ try_fdopen(fd, autoclose, level - 1)
+ GC.start
+ level
+ else
+ IO.for_fd(fd, autoclose: autoclose)
+ nil
+ end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment