Skip to content

[3.7] bpo-34587, test_socket: remove RDSTest.testCongestion() (GH-9277) #9368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2054,33 +2054,6 @@ def _testSelect(self):
self.data = b'select'
self.cli.sendto(self.data, 0, (HOST, self.port))

def testCongestion(self):
# wait until the sender is done
self.evt.wait()

def _testCongestion(self):
# test the behavior in case of congestion
self.data = b'fill'
self.cli.setblocking(False)
try:
# try to lower the receiver's socket buffer size
self.cli.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 16384)
except OSError:
pass
with self.assertRaises(OSError) as cm:
try:
# fill the receiver's socket buffer
while True:
self.cli.sendto(self.data, 0, (HOST, self.port))
finally:
# signal the receiver we're done
self.evt.set()
# sendto() should have failed with ENOBUFS
self.assertEqual(cm.exception.errno, errno.ENOBUFS)
# and we should have received a congestion notification through poll
r, w, x = select.select([self.serv], [], [], 3.0)
self.assertIn(self.serv, r)


@unittest.skipIf(fcntl is None, "need fcntl")
@unittest.skipUnless(HAVE_SOCKET_VSOCK,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test_socket: Remove RDSTest.testCongestion(). 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 just remove it.