test(anthropic): retry integration tests on transient failures (#37697)

Enable `pytest-retry` on the `integration_tests` Make target so live API
flakes (e.g. `test_batch` timing out against `api.anthropic.com`) no
longer fail the job on first miss. Matches the existing convention in
`libs/partners/groq`.
This commit is contained in:
Mason Daugherty
2026-05-26 11:02:53 -04:00
committed by GitHub
parent 53a5ac3352
commit c7858c46d8
3 changed files with 6 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ test tests:
uv run --group test pytest -vvv $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) uv run --group test pytest -vvv $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE)
integration_test integration_tests: integration_test integration_tests:
uv run --group test --group test_integration pytest -v --tb=short -n auto --timeout 30 $(TEST_FILE) uv run --group test --group test_integration pytest -v --tb=short -n auto --timeout 30 --retries 3 --retry-delay 1 $(TEST_FILE)
test_watch: test_watch:
uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE)

View File

@@ -124,6 +124,7 @@ addopts = "--snapshot-warn-unused --strict-markers --strict-config --durations=5
markers = [ markers = [
"requires: mark tests as requiring a specific library", "requires: mark tests as requiring a specific library",
"compile: mark placeholder test used to compile integration tests without running them", "compile: mark placeholder test used to compile integration tests without running them",
"retry: retry test if it fails",
] ]
asyncio_mode = "auto" asyncio_mode = "auto"

View File

@@ -538,7 +538,7 @@ requires-dist = [
{ name = "langchain-perplexity", marker = "extra == 'perplexity'" }, { name = "langchain-perplexity", marker = "extra == 'perplexity'" },
{ name = "langchain-together", marker = "extra == 'together'" }, { name = "langchain-together", marker = "extra == 'together'" },
{ name = "langchain-xai", marker = "extra == 'xai'" }, { name = "langchain-xai", marker = "extra == 'xai'" },
{ name = "langgraph", specifier = ">=1.2.0,<1.3.0" }, { name = "langgraph", specifier = ">=1.2.1,<1.3.0" },
{ name = "pydantic", specifier = ">=2.7.4,<3.0.0" }, { name = "pydantic", specifier = ">=2.7.4,<3.0.0" },
] ]
provides-extras = ["community", "anthropic", "openai", "azure-ai", "google-vertexai", "google-genai", "fireworks", "ollama", "together", "mistralai", "huggingface", "groq", "aws", "baseten", "deepseek", "xai", "perplexity"] provides-extras = ["community", "anthropic", "openai", "azure-ai", "google-vertexai", "google-genai", "fireworks", "ollama", "together", "mistralai", "huggingface", "groq", "aws", "baseten", "deepseek", "xai", "perplexity"]
@@ -779,7 +779,7 @@ typing = [
[[package]] [[package]]
name = "langgraph" name = "langgraph"
version = "1.2.0" version = "1.2.1"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "langchain-core" }, { name = "langchain-core" },
@@ -789,9 +789,9 @@ dependencies = [
{ name = "pydantic" }, { name = "pydantic" },
{ name = "xxhash" }, { name = "xxhash" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/58/61/d5d25e783035aa307d289b37e082258a6061c0fb4caa4a284f3bf1e87169/langgraph-1.2.0.tar.gz", hash = "sha256:4a9baaf62afc5d5f63144a50095140a34b9aa9b7cea695d25326d564775348e7", size = 690248, upload-time = "2026-05-12T03:46:39.164Z" } sdist = { url = "https://files.pythonhosted.org/packages/1c/8e/34a57e338a319e3b32c1bd183c2a9a04f7f35d683d3f3d8f597f6eacbc4e/langgraph-1.2.1.tar.gz", hash = "sha256:28314f844678d9d307cbd63e7b48b0145bf17177d84b40ee2921061e07b6f966", size = 693750, upload-time = "2026-05-21T18:33:07.478Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/f6/e8/e3304ac0015c2bdb04ad9785e4ed65c788855ce7857ce6104dd2f5d322db/langgraph-1.2.0-py3-none-any.whl", hash = "sha256:03fd5895a8d4b70db1ff63ebc3bacead29dd20cd794a8b1a483e7ec9018f7a65", size = 234262, upload-time = "2026-05-12T03:46:37.971Z" }, { url = "https://files.pythonhosted.org/packages/73/8c/313912e26866893bd15be9b4ea3442dc86f69270b0ad01a4961d1eba7118/langgraph-1.2.1-py3-none-any.whl", hash = "sha256:5cc4020de8f1e2a048d773f6e9128646a2af8c68a8067ab9cab177a2fcc8d221", size = 235317, upload-time = "2026-05-21T18:33:05.687Z" },
] ]
[[package]] [[package]]