Skip to content

Commit 6db8053

Browse files
whitslackrustyrussell
authored andcommitted
tests/test_misc.py: fix another "AF_UNIX path too long"
Also, avoid resource leak by explicitly closing socket. Changelog-None
1 parent 3c08a8b commit 6db8053

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,8 @@ def test_malformed_rpc(node_factory):
970970
obj, _ = l1.rpc._readobj(sock, b'')
971971
assert obj['error']['code'] == -32600
972972

973-
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
974-
sock.connect(l1.rpc.socket_path)
973+
sock.close()
974+
sock = connect_unix(l1.rpc.socket_path)
975975

976976
# Bad ID
977977
sock.sendall(b'{"id":{}, "jsonrpc":"2.0","method":"getinfo","params":[]}')

0 commit comments

Comments
 (0)