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 <1592116281.47.0.434434779546.issue30064@roundup.psfhosted.org>
In-reply-to
Content
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)?
History
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: <1592116281.47.0.434434779546.issue30064@roundup.psfhosted.org>
2020-06-14 06:31:21fantixlinkissue30064 messages
2020-06-14 06:31:21fantixcreate