perf(.github): set a timeout on get min versions HTTP calls (#35851)

During an automated code review of .github/scripts/get_min_versions.py,
the following issue was identified. Set a timeout on get min versions
HTTP calls. Network calls without a timeout can hang a worker
indefinitely. I kept the patch small and re-ran syntax checks after
applying it.
This commit is contained in:
Tejas Attarde
2026-03-13 17:24:32 -04:00
committed by GitHub
parent 9b22f9c450
commit d6dbcf6294
8 changed files with 19 additions and 15 deletions

View File

@@ -718,7 +718,7 @@ def test_image_token_counting_jpeg() -> None:
actual = model.get_num_tokens_from_messages([message])
assert expected == actual
image_data = base64.b64encode(httpx.get(image_url).content).decode("utf-8")
image_data = base64.b64encode(httpx.get(image_url, timeout=10.0).content).decode("utf-8")
message = HumanMessage(
content=[
{"type": "text", "text": "describe the weather in this image"},
@@ -750,7 +750,7 @@ def test_image_token_counting_png() -> None:
actual = model.get_num_tokens_from_messages([message])
assert expected == actual
image_data = base64.b64encode(httpx.get(image_url).content).decode("utf-8")
image_data = base64.b64encode(httpx.get(image_url, timeout=10.0).content).decode("utf-8")
message = HumanMessage(
content=[
{"type": "text", "text": "how many dice are in this image"},

View File

@@ -92,7 +92,7 @@ class TestOpenAIStandard(ChatModelIntegrationTests):
def test_openai_pdf_inputs(self, model: BaseChatModel) -> None:
"""Test that the model can process PDF inputs."""
url = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
pdf_data = base64.b64encode(httpx.get(url).content).decode("utf-8")
pdf_data = base64.b64encode(httpx.get(url, timeout=10.0).content).decode("utf-8")
message = HumanMessage(
[

View File

@@ -87,7 +87,7 @@ class TestOpenAIResponses(TestOpenAIStandard):
def test_openai_pdf_tool_messages(self, model: BaseChatModel) -> None:
"""Test that the model can process PDF inputs in `ToolMessage` objects."""
url = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
pdf_data = base64.b64encode(httpx.get(url).content).decode("utf-8")
pdf_data = base64.b64encode(httpx.get(url, timeout=10.0).content).decode("utf-8")
tool_message = ToolMessage(
content_blocks=[