[Python-checkins] bpo-34587, test_socket: remove RDSTest.testCongestion() (GH-9277)

Miss Islington (bot) webhook-mailer at python.org
Mon Sep 17 17:40:25 EDT 2018


https://github.com/python/cpython/commit/68a8f041051e8387583c66b91c7a3bbda6cf7e63
commit: 68a8f041051e8387583c66b91c7a3bbda6cf7e63
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-09-17T14:40:22-07:00
summary:

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 7484bdfd1e2e33fdd2c44dd4ffa044aacd495337)

Co-authored-by: Victor Stinner <vstinner at redhat.com>

files:
A Misc/NEWS.d/next/Tests/2018-09-13-20-58-07.bpo-34587.rCcxp3.rst
M Lib/test/test_socket.py

diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 77357868d9e1..cd249ff9b444 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1773,33 +1773,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.skipUnless(thread, 'Threading required for this test.')
 class BasicTCPTest(SocketConnectedTest):
diff --git a/Misc/NEWS.d/next/Tests/2018-09-13-20-58-07.bpo-34587.rCcxp3.rst b/Misc/NEWS.d/next/Tests/2018-09-13-20-58-07.bpo-34587.rCcxp3.rst
new file mode 100644
index 000000000000..8d45418aeab4
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-09-13-20-58-07.bpo-34587.rCcxp3.rst
@@ -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.



More information about the Python-checkins mailing list