Skip to content

Commit b551075

Browse files
committed
tests: treat ECONNRESET as EOF
If the other end of an AF_UNIX stream socket closes the socket without reading all data, read() and recv() will return ECONNRESET once all data has been read. For the purposes of the test suite, this is equivalent to normal EOF and should be treated as such. Fixes intermittent failures in test_run_dom0_service_socket_no_read().
1 parent 14cbe65 commit b551075

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qrexec/tests/socket/qrexec.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def sendall(self, data):
5454
def recvall(self, data_len):
5555
data = b""
5656
while len(data) < data_len:
57-
res = self.conn.recv(data_len - len(data))
57+
try:
58+
res = self.conn.recv(data_len - len(data))
59+
except ConnectionResetError:
60+
return data
5861
if not res:
5962
return data
6063
data += res

0 commit comments

Comments
 (0)