Skip to content

Commit 7484bdf

Browse files
authored
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.
1 parent 1fb399b commit 7484bdf

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
@@ -2054,33 +2054,6 @@ def _testSelect(self):
20542054
self.data = b'select'
20552055
self.cli.sendto(self.data, 0, (HOST, self.port))
20562056

2057-
def testCongestion(self):
2058-
# wait until the sender is done
2059-
self.evt.wait()
2060-
2061-
def _testCongestion(self):
2062-
# test the behavior in case of congestion
2063-
self.data = b'fill'
2064-
self.cli.setblocking(False)
2065-
try:
2066-
# try to lower the receiver's socket buffer size
2067-
self.cli.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 16384)
2068-
except OSError:
2069-
pass
2070-
with self.assertRaises(OSError) as cm:
2071-
try:
2072-
# fill the receiver's socket buffer
2073-
while True:
2074-
self.cli.sendto(self.data, 0, (HOST, self.port))
2075-
finally:
2076-
# signal the receiver we're done
2077-
self.evt.set()
2078-
# sendto() should have failed with ENOBUFS
2079-
self.assertEqual(cm.exception.errno, errno.ENOBUFS)
2080-
# and we should have received a congestion notification through poll
2081-
r, w, x = select.select([self.serv], [], [], 3.0)
2082-
self.assertIn(self.serv, r)
2083-
20842057

20852058
@unittest.skipIf(fcntl is None, "need fcntl")
20862059
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
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)