From 90fccd4d8758d120bd94b1e8527e0657ddaa6a2c Mon Sep 17 00:00:00 2001 From: Kerry Lu Date: Sat, 17 Oct 2026 13:25:29 -0700 Subject: [PATCH] test(e2e): get_text_external accepts JSON next to text so a pod-log error reads as the Kubernetes Status, not a 406 (#47150) Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/e2e/e2e_http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/e2e_http.py b/tests/e2e/e2e_http.py index 90a9e9367eb..2aea32909ce 100644 --- a/tests/e2e/e2e_http.py +++ b/tests/e2e/e2e_http.py @@ -507,11 +507,12 @@ def get_text_external( ca_bundle: str | None = None, ) -> str | NetworkError: """GET an absolute URL outside the proxy whose body is plain text (e.g. a pod log), not JSON. - A non-2xx status is reported as a NetworkError so the caller can fail loudly.""" + A non-2xx status is reported as a NetworkError so the caller can fail loudly. JSON is accepted too so an API + that answers an error as a JSON document (the Kubernetes Status on a pod log) returns that error instead of a 406.""" try: resp = requests.get( url, - headers={"Accept": "text/plain", **(_headers(headers) if headers is not None else {})}, + headers={"Accept": "text/plain, application/json", **(_headers(headers) if headers is not None else {})}, timeout=timeout, verify=ca_bundle if ca_bundle is not None else True, )