Skip to content

test: update pytest-isolate PR onto current main#28966

Closed
AJV20 wants to merge 2 commits into
NousResearch:mainfrom
AJV20:fix/pr-28956-supply-chain-rebase
Closed

test: update pytest-isolate PR onto current main#28966
AJV20 wants to merge 2 commits into
NousResearch:mainfrom
AJV20:fix/pr-28956-supply-chain-rebase

Conversation

@AJV20

@AJV20 AJV20 commented May 19, 2026

Copy link
Copy Markdown

Summary

  • Carries forward test: replace manual state-reset fixtures with pytest-isolate #28956's pytest-isolate change from a branch updated with current origin/main.
  • Removes the false-positive supply-chain audit surface caused by CI comparing current base SHA to an outdated PR head: hermes_cli/setup.py no longer appears in git diff origin/main..HEAD.
  • Keeps pytest-isolate exact-pinned as ==0.0.13, so the dependency-bounds check no longer sees an unbounded >= spec.

Supersedes/repairs #28956.

Verification

  • git diff --name-only origin/main..HEAD | grep -E '(^|/)(setup\.py|setup\.cfg|sitecustomize\.py|usercustomize\.py|__init__\.pth)$' → no output
  • Added-dependency grep from .github/workflows/supply-chain-audit.yml → no output
  • /Users/abdiel/.hermes/hermes-agent/venv/bin/python -m py_compile tests/conftest.py
  • uv run --extra dev python -m pytest tests/hermes_cli/test_setup_matrix_e2ee.py -q1 passed

ethernet8023 and others added 2 commits May 19, 2026 18:05
Each test now runs in a forked subprocess (--isolate), so module-level
dicts/sets/ContextVars can no longer leak between tests on the same
xdist worker. This eliminates the need for:

- _reset_module_state autouse fixture (~120 lines clearing approval
  state, gateway session ContextVars, terminal env caches, etc.)
- _enforce_test_timeout + _timeout_handler (SIGALRM-based 30s timeout)
- _reset_tool_registry_caches (registry + tool defs cache invalidation)

With isolation in place, bump the xdist worker cap from 4 to auto in
scripts/run_tests.sh and pyproject.toml addopts. Developers on big
machines finally get parallelism proportional to their core count.
@AJV20 AJV20 requested a review from a team May 19, 2026 22:27
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants