From 286f0fcd2103fe56835860d8f21b5a7f0e815a60 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:35:48 +0000 Subject: [PATCH 1/2] Initial plan From a9e0cccfb61e81153b8d32deacc3dd519a70d254 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:41:32 +0000 Subject: [PATCH 2/2] Suppress oversized dispatch log lines Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com> --- eng/scripts/dispatch_checks.py | 7 +++- .../tests/test_dispatch_checks.py | 36 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/eng/scripts/dispatch_checks.py b/eng/scripts/dispatch_checks.py index d9196d881337..b76cd188b97f 100644 --- a/eng/scripts/dispatch_checks.py +++ b/eng/scripts/dispatch_checks.py @@ -110,7 +110,12 @@ async def _pump(stream: Optional[asyncio.StreamReader], sink: IO[str]) -> str: return "" chunks: List[str] = [] while True: - line_b = await stream.readline() + try: + line_b = await stream.readline() + except (ValueError, asyncio.LimitOverrunError): + sink.write(prefix + "[suppressed oversized log line]\n") + sink.flush() + continue if not line_b: break line = line_b.decode(errors="replace") diff --git a/eng/tools/azure-sdk-tools/tests/test_dispatch_checks.py b/eng/tools/azure-sdk-tools/tests/test_dispatch_checks.py index c286d38c2e68..bbaeab141af8 100644 --- a/eng/tools/azure-sdk-tools/tests/test_dispatch_checks.py +++ b/eng/tools/azure-sdk-tools/tests/test_dispatch_checks.py @@ -1,3 +1,5 @@ +import asyncio +from io import StringIO import os import sys from types import SimpleNamespace @@ -10,7 +12,7 @@ if REPO_ROOT not in sys.path: sys.path.insert(0, REPO_ROOT) -from eng.scripts.dispatch_checks import get_check_dest_dir +from eng.scripts.dispatch_checks import _tee_stream, get_check_dest_dir def test_apistub_dest_dir_uses_package_subdirectory(): @@ -45,3 +47,35 @@ def test_empty_dest_dir_is_unchanged(): assert result is None parsed_setup.assert_not_called() + + +def test_tee_stream_suppresses_oversized_line(): + class Stream: + def __init__(self): + self.lines = [asyncio.LimitOverrunError("line is too long", 0), b"next line\n", b""] + + async def readline(self): + line = self.lines.pop(0) + if isinstance(line, Exception): + raise line + return line + + class Process: + def __init__(self): + self.stdout = Stream() + self.stderr = Stream() + + async def wait(self): + pass + + stdout_sink = StringIO() + stderr_sink = StringIO() + with patch("eng.scripts.dispatch_checks.sys.stdout", stdout_sink), patch( + "eng.scripts.dispatch_checks.sys.stderr", stderr_sink + ): + stdout, stderr = asyncio.run(_tee_stream(Process(), "/tmp/package", "check")) + + assert stdout == "next line\n" + assert stderr == "next line\n" + assert stdout_sink.getvalue() == "[package :: check] [suppressed oversized log line]\n[package :: check] next line\n" + assert stderr_sink.getvalue() == "[package :: check] [suppressed oversized log line]\n[package :: check] next line\n"