Message371490
OK I think I solved the problem by improving the two loops using smarter buffer sizes:
# fill the buffer until sending 5 chars would block
size = 8192
while size > 5:
with self.assertRaises(BlockingIOError):
while True:
sock.send(b' ' * size)
size = int(size / 2)
and
# receive everything that is not a space
async def recv_all():
rv = b''
while True:
buf = await self.loop.sock_recv(server, 8192)
if not buf:
return rv
rv += buf.strip()
This test is now running ~25x faster, and the load test crashed my laptop a few times before it hits a timeout.
Last question before PR pls: given the fact that this test is to cover a fixed case when loop.sock_*() was hanging forever, should I keep the wait_for(..., timeout=10)? |
|
Date |
User |
Action |
Args |
2020-06-14 06:31:21 | fantix | set | recipients:
+ fantix, vstinner, ned.deily, asvetlov, abacabadabacaba, lukasz.langa, yselivanov, achimnol, miss-islington, aeros |
2020-06-14 06:31:21 | fantix | set | messageid: <1592116281.47.0.434434779546.issue30064@roundup.psfhosted.org> |
2020-06-14 06:31:21 | fantix | link | issue30064 messages |
2020-06-14 06:31:21 | fantix | create | |
|