From: Richard Oudkerk Date: Mon, 30 Apr 2012 13:48:50 +0000 (+0100) Subject: Minor fix for multiprocessing unit test X-Git-Tag: v3.3.0a3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4460c3476d9099d0e05db8a763053c973d2d8be8;p=python Minor fix for multiprocessing unit test Read from socket might have returned partial message. --- diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 799be702fc..089b76fd7a 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -2034,7 +2034,14 @@ class _TestPicklingConnections(BaseTestCase): address = lconn.recv() rconn.send((address, msg)) new_conn = lconn.recv() - self.assertEqual(new_conn.recv(100), msg.upper()) + buf = [] + while True: + s = new_conn.recv(100) + if not s: + break + buf.append(s) + buf = b''.join(buf) + self.assertEqual(buf, msg.upper()) new_conn.close() lconn.send(None)