Skip to content

Commit

Permalink
tests: treat ECONNRESET as EOF
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
DemiMarie committed Apr 1, 2024
1 parent 14cbe65 commit b551075
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qrexec/tests/socket/qrexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def sendall(self, data):
def recvall(self, data_len):
data = b""
while len(data) < data_len:
res = self.conn.recv(data_len - len(data))
try:
res = self.conn.recv(data_len - len(data))
except ConnectionResetError:
return data
if not res:
return data
data += res
Expand Down

0 comments on commit b551075

Please sign in to comment.