This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fantix
Recipients abacabadabacaba, achimnol, aeros, asvetlov, fantix, lukasz.langa, miss-islington, ned.deily, vstinner, yselivanov
Date 2020-06-14.06:31:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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)


            # 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:21fantixsetrecipients: + fantix, vstinner, ned.deily, asvetlov, abacabadabacaba, lukasz.langa, yselivanov, achimnol, miss-islington, aeros
2020-06-14 06:31:21fantixsetmessageid: <>
2020-06-14 06:31:21fantixlinkissue30064 messages
2020-06-14 06:31:21fantixcreate