Skip to content

Commit 08e2a39

Browse files
committed
remove test_datagram_write_error_resumes_paused_protocol_from_callback
1 parent 5c71eb7 commit 08e2a39

1 file changed

Lines changed: 6 additions & 20 deletions

File tree

Lib/test/test_asyncio/test_events.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ def create_socket():
16011601
transport_1.close()
16021602
transport_2.close()
16031603

1604-
def _test_datagram_write_error_resumes_paused_protocol(self, first, second):
1604+
def test_datagram_write_error_resumes_paused_protocol(self):
16051605
# See https://github.com/python/cpython/issues/156698: a
16061606
# datagram write error must not strand data left in the write
16071607
# buffer, nor leave a paused protocol paused forever.
@@ -1637,11 +1637,11 @@ def error_received(self, exc):
16371637
# anything is left in the write buffer.
16381638
transport.set_write_buffer_limits(0)
16391639

1640-
# The first sendto() may arm an in-flight write, so the second
1641-
# one can end up queued behind it; queuing is what trips
1642-
# pause_writing() at a high water mark of 0.
1643-
transport.sendto(first, addr)
1644-
transport.sendto(second, addr)
1640+
# The oversized datagram fails while it is in flight, and the
1641+
# normal datagram behind it is left queued -- queuing is also
1642+
# what trips pause_writing() at a high water mark of 0.
1643+
transport.sendto(b'\x00' * 70000, addr)
1644+
transport.sendto(b'queued', addr)
16451645

16461646
loop.run_until_complete(
16471647
asyncio.wait_for(protocol.error_received_event,
@@ -1661,20 +1661,6 @@ def error_received(self, exc):
16611661
transport.close()
16621662
test_utils.run_briefly(loop)
16631663

1664-
def test_datagram_write_error_resumes_paused_protocol_in_flight(self):
1665-
# oversized datagram fails while in flight; a normal datagram
1666-
# queued right behind it must not be stranded.
1667-
oversized = b'\x00' * 70000
1668-
self._test_datagram_write_error_resumes_paused_protocol(
1669-
oversized, b'queued')
1670-
1671-
def test_datagram_write_error_resumes_paused_protocol_from_callback(self):
1672-
# oversized datagram fails once it reaches the front of the
1673-
# buffer; the protocol must not stay paused forever.
1674-
oversized = b'\x00' * 70000
1675-
self._test_datagram_write_error_resumes_paused_protocol(
1676-
b'ok', oversized)
1677-
16781664
def test_datagram_write_error_reentrant_sendto(self):
16791665
# See https://github.com/python/cpython/issues/156698: an
16801666
# error_received() callback that sends more data synchronously

0 commit comments

Comments
 (0)