From 3b999176c84c1236e1f6fbaa5194782360e82264 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Thu, 4 Jun 2026 13:25:26 -0400 Subject: [PATCH] test(langchain,partners): disable pytest-benchmark under xdist to silence `PytestBenchmarkWarning` (#37901) Test targets run with `-n auto`, which makes `pytest-benchmark` (present via `langchain-tests`) auto-disable itself and emit a `PytestBenchmarkWarning` once per xdist worker. Passing `--benchmark-disable` turns the plugin off explicitly so the warning never fires, matching what `core` and `langchain_v1` already do. ## Changes - Add `--benchmark-disable` to the `-n auto` test targets across `langchain` (unit) and 14 partner packages' integration targets: `anthropic`, `chroma`, `deepseek`, `exa`, `fireworks`, `groq`, `huggingface`, `mistralai`, `nomic`, `ollama`, `openai`, `openrouter`, `qdrant`, `xai`. - Deliberately excluded `text-splitters` and `model-profiles`: their `test` group doesn't install `pytest-benchmark`, so the flag would fail with `unrecognized arguments`. Verified by importing the plugin under each package's actual dependency group before editing. --- libs/langchain/Makefile | 2 +- libs/partners/anthropic/Makefile | 2 +- libs/partners/chroma/Makefile | 2 +- libs/partners/deepseek/Makefile | 2 +- libs/partners/exa/Makefile | 2 +- libs/partners/fireworks/Makefile | 2 +- libs/partners/groq/Makefile | 2 +- libs/partners/huggingface/Makefile | 2 +- libs/partners/mistralai/Makefile | 2 +- libs/partners/nomic/Makefile | 2 +- libs/partners/ollama/Makefile | 2 +- libs/partners/openai/Makefile | 2 +- libs/partners/openrouter/Makefile | 2 +- libs/partners/qdrant/Makefile | 2 +- libs/partners/xai/Makefile | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libs/langchain/Makefile b/libs/langchain/Makefile index b1204179bfb..421d4a5b755 100644 --- a/libs/langchain/Makefile +++ b/libs/langchain/Makefile @@ -23,7 +23,7 @@ coverage: $(TEST_FILE) test tests: - uv run --group test pytest -n auto $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) + uv run --group test pytest -n auto --benchmark-disable $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) extended_tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket --only-extended tests/unit_tests diff --git a/libs/partners/anthropic/Makefile b/libs/partners/anthropic/Makefile index c85d9bd7a78..6f4c846a98b 100644 --- a/libs/partners/anthropic/Makefile +++ b/libs/partners/anthropic/Makefile @@ -15,7 +15,7 @@ test tests: uv run --group test pytest -vvv $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto --timeout 30 --retries 3 --retry-delay 1 $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable --timeout 30 --retries 3 --retry-delay 1 $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/chroma/Makefile b/libs/partners/chroma/Makefile index 5248da9278d..9cd2d1b6e8f 100644 --- a/libs/partners/chroma/Makefile +++ b/libs/partners/chroma/Makefile @@ -15,7 +15,7 @@ test tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/deepseek/Makefile b/libs/partners/deepseek/Makefile index f7ae818ca04..a57d25ef235 100644 --- a/libs/partners/deepseek/Makefile +++ b/libs/partners/deepseek/Makefile @@ -21,7 +21,7 @@ test_watch: # integration tests are run without the --disable-socket flag to allow network calls 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 --benchmark-disable --timeout=30 $(TEST_FILE) ###################### # LINTING AND FORMATTING diff --git a/libs/partners/exa/Makefile b/libs/partners/exa/Makefile index e01b9356c10..0b335b432eb 100644 --- a/libs/partners/exa/Makefile +++ b/libs/partners/exa/Makefile @@ -16,7 +16,7 @@ test: uv run --group test --group test_integration pytest $(PYTEST_EXTRA) $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(PYTEST_EXTRA) $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(PYTEST_EXTRA) $(TEST_FILE) tests: uv run --group test pytest $(PYTEST_EXTRA) $(TEST_FILE) diff --git a/libs/partners/fireworks/Makefile b/libs/partners/fireworks/Makefile index 6d8c3b19290..2c41629412e 100644 --- a/libs/partners/fireworks/Makefile +++ b/libs/partners/fireworks/Makefile @@ -15,7 +15,7 @@ test tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto --retries 3 --retry-delay 2 $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable --retries 3 --retry-delay 2 $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/groq/Makefile b/libs/partners/groq/Makefile index 8f29852825a..c4df8ea33f8 100644 --- a/libs/partners/groq/Makefile +++ b/libs/partners/groq/Makefile @@ -16,7 +16,7 @@ test tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto --retries 3 --retry-delay 1 $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable --retries 3 --retry-delay 1 $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/huggingface/Makefile b/libs/partners/huggingface/Makefile index e2bd889e366..648e2460e56 100644 --- a/libs/partners/huggingface/Makefile +++ b/libs/partners/huggingface/Makefile @@ -16,7 +16,7 @@ test tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/mistralai/Makefile b/libs/partners/mistralai/Makefile index 4a9b915e6b4..97d56a39d58 100644 --- a/libs/partners/mistralai/Makefile +++ b/libs/partners/mistralai/Makefile @@ -21,7 +21,7 @@ test_watch: integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto --retries 3 --retry-delay 2 $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable --retries 3 --retry-delay 2 $(TEST_FILE) ###################### diff --git a/libs/partners/nomic/Makefile b/libs/partners/nomic/Makefile index 895e42a9a50..f28a2441b16 100644 --- a/libs/partners/nomic/Makefile +++ b/libs/partners/nomic/Makefile @@ -16,7 +16,7 @@ test: uv run --group test --group test_integration pytest $(PYTEST_EXTRA) $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(PYTEST_EXTRA) $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(PYTEST_EXTRA) $(TEST_FILE) tests: uv run --group test pytest $(PYTEST_EXTRA) $(TEST_FILE) diff --git a/libs/partners/ollama/Makefile b/libs/partners/ollama/Makefile index 7698174d60c..4fa1cec6fcf 100644 --- a/libs/partners/ollama/Makefile +++ b/libs/partners/ollama/Makefile @@ -27,7 +27,7 @@ test_watch: # integration tests are run without the --disable-socket flag to allow network calls integration_test: - OLLAMA_TEST_MODEL=$(OLLAMA_TEST_MODEL) OLLAMA_REASONING_TEST_MODEL=$(OLLAMA_REASONING_TEST_MODEL) uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + OLLAMA_TEST_MODEL=$(OLLAMA_TEST_MODEL) OLLAMA_REASONING_TEST_MODEL=$(OLLAMA_REASONING_TEST_MODEL) uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) # CI integration tests - disabled until ollama service is configured in CI diff --git a/libs/partners/openai/Makefile b/libs/partners/openai/Makefile index 087b2c9c04f..c4ffe78aa26 100644 --- a/libs/partners/openai/Makefile +++ b/libs/partners/openai/Makefile @@ -25,7 +25,7 @@ test tests: TIKTOKEN_CACHE_DIR=tiktoken_cache uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) # Run VCR cassette-backed integration tests in playback-only mode (no API keys needed). # Catches stale cassettes caused by test input changes without re-recording. diff --git a/libs/partners/openrouter/Makefile b/libs/partners/openrouter/Makefile index 4f0f537496e..3259904a978 100644 --- a/libs/partners/openrouter/Makefile +++ b/libs/partners/openrouter/Makefile @@ -21,7 +21,7 @@ test_watch: # integration tests are run without the --disable-socket flag to allow network calls integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto --timeout=120 $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable --timeout=120 $(TEST_FILE) ###################### # LINTING AND FORMATTING diff --git a/libs/partners/qdrant/Makefile b/libs/partners/qdrant/Makefile index c53ee48ac9e..af402f46f2a 100644 --- a/libs/partners/qdrant/Makefile +++ b/libs/partners/qdrant/Makefile @@ -16,7 +16,7 @@ test tests: uv run --group test pytest $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) diff --git a/libs/partners/xai/Makefile b/libs/partners/xai/Makefile index d92cf3637ab..3642ccafa6d 100644 --- a/libs/partners/xai/Makefile +++ b/libs/partners/xai/Makefile @@ -19,7 +19,7 @@ test_watch: uv run --group test ptw --snapshot-update --now . -- -vv $(TEST_FILE) integration_test integration_tests: - uv run --group test --group test_integration pytest -v --tb=short -n auto $(TEST_FILE) + uv run --group test --group test_integration pytest -v --tb=short -n auto --benchmark-disable $(TEST_FILE) ###################### # LINTING AND FORMATTING