Skip to content

Commit 5029b6d

Browse files
committed
Fix leaking file descriptor for Ruby 3.4
The changes in net-ftp are a brute force way to find issues in the CI. They might not work, and will probably be reverted.
1 parent 697c22e commit 5029b6d

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

library/net-ftp/mkdir_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
after :each do
1515
@ftp.quit rescue nil
16-
@ftp.close
16+
@ftp.close rescue nil
1717
@server.stop
1818
end
1919

library/net-ftp/mtime_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
after :each do
1515
@ftp.quit rescue nil
16-
@ftp.close
16+
@ftp.close rescue nil
1717
@server.stop
1818
end
1919

library/net-ftp/voidcmd_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
after :each do
1515
@ftp.quit rescue nil
16-
@ftp.close
16+
@ftp.close rescue nil
1717
@server.stop
1818
end
1919

library/socket/socket/connect_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
client.connect(address)
6868
rescue Errno::ECONNREFUSED
6969
skip "Outgoing packets may be filtered"
70+
ensure
71+
client.close if client
7072
end
7173
}.should raise_error(IO::TimeoutError)
7274
end

0 commit comments

Comments
 (0)