diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-04-06 16:02:24 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-04-06 16:03:20 +0900 |
commit | 31ba81788729944705e9f666b52c5ca4990c311d (patch) | |
tree | ad1c955e8c0985281dc97cefe27e860990fa9581 /test/drb | |
parent | 93c73ab8982b23faed6d19b82c0f17de9338ff13 (diff) | |
download | ruby-31ba81788729944705e9f666b52c5ca4990c311d.tar.gz |
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>
```
Diffstat (limited to 'test/drb')
-rw-r--r-- | test/drb/test_drb.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb index 47b2966ae2..1024618840 100644 --- a/test/drb/test_drb.rb +++ b/test/drb/test_drb.rb @@ -342,7 +342,9 @@ class TestDRbTCP < Test::Unit::TestCase socket.close client = DRb::DRbTCPSocket.new(server.uri, socket) assert client - client.close + ensure + client&.close + socket&.close server.stop_service server.thread.join DRb::DRbConn.stop_pool |