Skip to content

Commit 31ba817

Browse files
committed
Try to fix Leaked file descriptor
https://github.com/ruby/ruby/runs/2274767991?check_suite_focus=true#step:15:118 ``` Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 7 : #<TCPServer:fd 7, AF_INET, 0.0.0.0, 42451> Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 9 : #<IO:fd 9> Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 10 : #<IO:fd 10> ```
1 parent 93c73ab commit 31ba817

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/drb/test_drb.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ def test_immediate_close
342342
socket.close
343343
client = DRb::DRbTCPSocket.new(server.uri, socket)
344344
assert client
345-
client.close
345+
ensure
346+
client&.close
347+
socket&.close
346348
server.stop_service
347349
server.thread.join
348350
DRb::DRbConn.stop_pool

0 commit comments

Comments
 (0)