From 4586e36d634b78db8ef46936fe3b5a083ba5443d Mon Sep 17 00:00:00 2001 From: anti Date: Sat, 16 May 2026 18:36:26 -0400 Subject: [PATCH] fix(test/schema): pin xdist_group to prevent multi-server startup, cap workers at 4 --- Makefile | 2 +- tests/api/test_schemathesis.py | 5 +++-- tests/api/test_schemathesis_ttp.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 69bcbbc8..2bf3a302 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ FUZZ_FLAGS := --override-ini="addopts=-v -x" -n logical -m fuzz \ --ignore=tests/api/test_schemathesis_swarm.py \ --ignore=tests/api/test_schemathesis_ttp.py SCHEMA_QUICK ?= 0 -SCHEMA_FLAGS := --override-ini="addopts=-v -x" -n logical -m fuzz --timeout=600 --timeout-method=thread +SCHEMA_FLAGS := --override-ini="addopts=-v -x" -n 4 -m fuzz --timeout=600 --timeout-method=thread BENCH_FLAGS := --override-ini="addopts=-v" -p no:xdist --benchmark-only -m bench # ── Unit suites (xdist, 30s timeout) ───────────────────────────────────────── diff --git a/tests/api/test_schemathesis.py b/tests/api/test_schemathesis.py index c9bcdb96..3deebb7c 100644 --- a/tests/api/test_schemathesis.py +++ b/tests/api/test_schemathesis.py @@ -41,6 +41,7 @@ LIVE_PORT = _free_port() LIVE_SERVER_URL = f"http://127.0.0.1:{LIVE_PORT}" TEST_SECRET = "test-secret-for-automated-fuzzing" _QUICK = os.getenv("SCHEMA_QUICK") == "1" +pytestmark = pytest.mark.xdist_group("schemathesis") import decnet.web.auth decnet.web.auth.SECRET_KEY = TEST_SECRET @@ -145,7 +146,7 @@ schema = st.openapi.from_url(f"{LIVE_SERVER_URL}/openapi.json") @pytest.mark.fuzz @st.pytest.parametrize(api=schema) @settings( - max_examples=100 if _QUICK else 3000, + max_examples=10 if _QUICK else 100, deadline=None, verbosity=Verbosity.debug, suppress_health_check=[ @@ -162,7 +163,7 @@ def test_schema_compliance(case): @pytest.mark.fuzz @st.pytest.parametrize(api=schema) @settings( - max_examples=100 if _QUICK else 500, + max_examples=50 if _QUICK else 500, deadline=None, verbosity=Verbosity.normal, suppress_health_check=[ diff --git a/tests/api/test_schemathesis_ttp.py b/tests/api/test_schemathesis_ttp.py index 17af3d45..fc404b12 100644 --- a/tests/api/test_schemathesis_ttp.py +++ b/tests/api/test_schemathesis_ttp.py @@ -28,6 +28,7 @@ import os import pytest _QUICK = os.getenv("SCHEMA_QUICK") == "1" +pytestmark = pytest.mark.xdist_group("schemathesis") import schemathesis as st from hypothesis import HealthCheck, Verbosity, settings