bpo-30064: Fix slow asyncio sock test by fantix · Pull Request #20868 · python/cpython

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR @fantix. With both the usage of SO_SNDBUF to reduce the send buffer size and the changes to start with a higher send size of 8192, then reducing by half each time (log2n), this seems to completely address the timeout issue. Even with running 200 parallel jobs for ~1000 test iterations, I did not receive any failures. With the previous version, I was able to immediately create a failure using 100 parallel jobs in the first batch of tests.

Since this patch is fairly straightforward and should be included as soon as possible to avoid further intermittent buildbot failures, I'll proceed with merging it. That being said, I would greatly appreciate a post-commit review from @1st1 and/or @asvetlov whenever they can find the time to do so.