Skip to content

Commit 79ed2f7

Browse files
committed
pyln-testing: Fix BitcoinD fd leak
1 parent c5fc1b5 commit 79ed2f7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contrib/pyln-testing/pyln/testing/fixtures.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ def bitcoind(directory, teardown_checks):
164164
bitcoind.proc.kill()
165165
bitcoind.proc.wait()
166166

167+
# Ensure file descriptors are not leaking.
168+
for f in ["stdout_write", "stderr_write", "stdout_read", "stderr_read"]:
169+
try:
170+
getattr(bitcoind, f).close()
171+
except Exception:
172+
pass
173+
167174

168175
class TeardownErrors(object):
169176
def __init__(self):

0 commit comments

Comments
 (0)