Skip to content

Commit 68a8f04

Browse files
bpo-34587, test_socket: remove RDSTest.testCongestion() (GH-9277)
The test tries to fill the receiver's socket buffer and expects an error. But the RDS protocol doesn't require that. Moreover, the Linux implementation of RDS expects that the producer of the messages reduces its rate, it's not the role of the receiver to trigger an error. The test fails on Fedora 28 by design, so remove it. (cherry picked from commit 7484bdf) Co-authored-by: Victor Stinner <[email protected]>
1 parent 83a0985 commit 68a8f04

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

Lib/test/test_socket.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,33 +1773,6 @@ def _testSelect(self):
17731773
self.data = b'select'
17741774
self.cli.sendto(self.data, 0, (HOST, self.port))
17751775

1776-
def testCongestion(self):
1777-
# wait until the sender is done
1778-
self.evt.wait()
1779-
1780-
def _testCongestion(self):
1781-
# test the behavior in case of congestion
1782-
self.data = b'fill'
1783-
self.cli.setblocking(False)
1784-
try:
1785-
# try to lower the receiver's socket buffer size
1786-
self.cli.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 16384)
1787-
except OSError:
1788-
pass
1789-
with self.assertRaises(OSError) as cm:
1790-
try:
1791-
# fill the receiver's socket buffer
1792-
while True:
1793-
self.cli.sendto(self.data, 0, (HOST, self.port))
1794-
finally:
1795-
# signal the receiver we're done
1796-
self.evt.set()
1797-
# sendto() should have failed with ENOBUFS
1798-
self.assertEqual(cm.exception.errno, errno.ENOBUFS)
1799-
# and we should have received a congestion notification through poll
1800-
r, w, x = select.select([self.serv], [], [], 3.0)
1801-
self.assertIn(self.serv, r)
1802-
18031776

18041777
@unittest.skipUnless(thread, 'Threading required for this test.')
18051778
class BasicTCPTest(SocketConnectedTest):
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test_socket: Remove RDSTest.testCongestion(). The test tries to fill the
2+
receiver's socket buffer and expects an error. But the RDS protocol doesn't
3+
require that. Moreover, the Linux implementation of RDS expects that the
4+
producer of the messages reduces its rate, it's not the role of the receiver to
5+
trigger an error. The test fails on Fedora 28 by design, so just remove it.

0 commit comments

Comments
 (0)