Make the unit suite fast: in-process HTTP tests, no real sleeps, parallel Windows CI (#4554)

This commit is contained in:
Jeremiah Lowin 2026-07-20 10:51:14 -04:00 committed by GitHub
commit b0e782a2ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 1714 additions and 513 deletions

View file

@ -19,7 +19,7 @@ runs:
MAX_PROCS="2"
EXTRA_FLAGS=""
elif [ "${{ inputs.test-type }}" == "client_process" ]; then
MARKER="client_process"
MARKER="client_process or subprocess_heavy"
TIMEOUT="5"
MAX_PROCS="0"
EXTRA_FLAGS="-x"
@ -29,14 +29,20 @@ runs:
MAX_PROCS="0"
EXTRA_FLAGS="-x"
else
MARKER="not integration and not client_process and not conformance"
MARKER="not integration and not client_process and not subprocess_heavy and not conformance"
TIMEOUT="5"
MAX_PROCS="4"
EXTRA_FLAGS=""
fi
# Windows previously ran serially: parallel workers crashed intermittently
# when many tests spawned stdio subprocesses (#2715, reverted in #2726).
# Most of those tests now run in-memory, but tests that spawn a fresh
# interpreter importing all of FastMCP still crash xdist workers on the
# 2-core Windows runners. They carry the subprocess_heavy marker and run
# in the serial client_process step instead.
PARALLEL_FLAGS=""
if [ "$MAX_PROCS" != "0" ] && [ "${{ runner.os }}" != "Windows" ]; then
if [ "$MAX_PROCS" != "0" ]; then
PARALLEL_FLAGS="--numprocesses auto --maxprocesses $MAX_PROCS --dist worksteal"
fi

View file

@ -48,7 +48,7 @@ jobs:
- name: Run unit tests
uses: ./.github/actions/run-pytest
- name: Run client process tests
- name: Run serial subprocess tests
uses: ./.github/actions/run-pytest
with:
test-type: client_process
@ -69,7 +69,7 @@ jobs:
- name: Run unit tests
uses: ./.github/actions/run-pytest
- name: Run client process tests
- name: Run serial subprocess tests
uses: ./.github/actions/run-pytest
with:
test-type: client_process

View file

@ -67,7 +67,7 @@ jobs:
- name: Run unit tests
uses: ./.github/actions/run-pytest
- name: Run client process tests
- name: Run serial subprocess tests
uses: ./.github/actions/run-pytest
with:
test-type: client_process