fix(test/schema): pin xdist_group to prevent multi-server startup, cap workers at 4
Some checks failed
CI / Test (Standard) (3.11) (push) Has been skipped
CI / Test (Live) (3.11) (push) Has been skipped
CI / Merge testing → main (push) Has been skipped
CI / Lint (ruff) (push) Successful in 1m0s
CI / Dependency audit (pip-audit) (push) Failing after 1m2s
CI / SAST (bandit) (push) Successful in 1m11s
CI / Merge dev → testing (push) Has been skipped

This commit is contained in:
2026-05-16 18:36:26 -04:00
parent 8b3f74b39b
commit 4586e36d63
3 changed files with 5 additions and 3 deletions

View File

@@ -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_swarm.py \
--ignore=tests/api/test_schemathesis_ttp.py --ignore=tests/api/test_schemathesis_ttp.py
SCHEMA_QUICK ?= 0 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 BENCH_FLAGS := --override-ini="addopts=-v" -p no:xdist --benchmark-only -m bench
# ── Unit suites (xdist, 30s timeout) ───────────────────────────────────────── # ── Unit suites (xdist, 30s timeout) ─────────────────────────────────────────

View File

@@ -41,6 +41,7 @@ LIVE_PORT = _free_port()
LIVE_SERVER_URL = f"http://127.0.0.1:{LIVE_PORT}" LIVE_SERVER_URL = f"http://127.0.0.1:{LIVE_PORT}"
TEST_SECRET = "test-secret-for-automated-fuzzing" TEST_SECRET = "test-secret-for-automated-fuzzing"
_QUICK = os.getenv("SCHEMA_QUICK") == "1" _QUICK = os.getenv("SCHEMA_QUICK") == "1"
pytestmark = pytest.mark.xdist_group("schemathesis")
import decnet.web.auth import decnet.web.auth
decnet.web.auth.SECRET_KEY = TEST_SECRET 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 @pytest.mark.fuzz
@st.pytest.parametrize(api=schema) @st.pytest.parametrize(api=schema)
@settings( @settings(
max_examples=100 if _QUICK else 3000, max_examples=10 if _QUICK else 100,
deadline=None, deadline=None,
verbosity=Verbosity.debug, verbosity=Verbosity.debug,
suppress_health_check=[ suppress_health_check=[
@@ -162,7 +163,7 @@ def test_schema_compliance(case):
@pytest.mark.fuzz @pytest.mark.fuzz
@st.pytest.parametrize(api=schema) @st.pytest.parametrize(api=schema)
@settings( @settings(
max_examples=100 if _QUICK else 500, max_examples=50 if _QUICK else 500,
deadline=None, deadline=None,
verbosity=Verbosity.normal, verbosity=Verbosity.normal,
suppress_health_check=[ suppress_health_check=[

View File

@@ -28,6 +28,7 @@ import os
import pytest import pytest
_QUICK = os.getenv("SCHEMA_QUICK") == "1" _QUICK = os.getenv("SCHEMA_QUICK") == "1"
pytestmark = pytest.mark.xdist_group("schemathesis")
import schemathesis as st import schemathesis as st
from hypothesis import HealthCheck, Verbosity, settings from hypothesis import HealthCheck, Verbosity, settings