Minor fix for multiprocessing unit test

Read from socket might have returned partial message.
This commit is contained in:
Richard Oudkerk 2012-04-30 14:48:50 +01:00
parent 3e268aac3b
commit 4460c3476d
1 changed files with 8 additions and 1 deletions

View File

@ -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)