Skip to content

Commit 8712ac7

Browse files
committed
Fix tempfile leaking in TestRequire
The test introduced in 928fea3 is leaking files because the Tempfile is not cleaned when the process exits. We see this in the output: Children under /var/folders/51/_yzlsvf96v9729jtj8_mcp7w0000gn/T/rubytest.7lbdlp: * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-g4op87.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-pu621v.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-4xv688.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-1rvp4b.rb
1 parent 13c2f8d commit 8712ac7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/ruby/test_require.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def to_str
857857
def to_path = @path
858858
end
859859
860-
def create_ruby_file = Tempfile.create(["test", ".rb"]).path
860+
def create_ruby_file = Tempfile.open(["test", ".rb"]).path
861861
862862
require MyString.new(create_ruby_file)
863863
$LOADED_FEATURES.unshift(create_ruby_file)

0 commit comments

Comments
 (0)