This mitigates #15400
I had a look into the issue today and this seems to be the best we can do given that the root causes some unexpected custom error code from the macOS kernel that python/asyncio doesn't know how to handle properly yet.
Concept ACK. Would be nice if someone with a mac could verify that this test is flaky before this commit and not flaky after this commit.
The testing I did as part of #14814 indicates that it is macOS-specific and is related to asyncio. This does not affect Linux.
Concept ACK - also in line with older comments #14522 (comment) regarding this test.
Concept ACK
Would be nice if someone with a mac could verify that this test is flaky before this commit and not flaky after this commit.
I see the p2p_invalid_messages randomly fail quite frequently (using master). I ran the p2p_invalid_messages test in a loop for a while with this change I haven't seen a single failure.
Post-merge ACK - thanks for fixing this.