Skip to content

fix(ci): eliminate PyO3 finalization SIGABRT and pip cache warning#88

Merged
pratyush618 merged 2 commits intomasterfrom
fix/ci-pyo3-finalization-and-pip-cache-warning
Apr 30, 2026
Merged

fix(ci): eliminate PyO3 finalization SIGABRT and pip cache warning#88
pratyush618 merged 2 commits intomasterfrom
fix/ci-pyo3-finalization-and-pip-cache-warning

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

Two CI annotations on every PR run, both pre-existing on master:

  1. `Tests passed but process crashed during cleanup (known PyO3 issue)` on Linux/macOS Python tests. Pytest exited with SIGABRT (134) because PyO3-backed daemon threads (heartbeat, async executor, webhook delivery, distributed-lock extender) tried to (re)acquire the GIL after `Py_Finalize` had torn it down. The CI step had a junit-XML fallback that swallowed the abort if no test actually failed — but the warning still surfaced as noise.

  2. `Cache entry deserialization failed, entry ignored` on macOS Python 3.10. Pip's HTTP cache (used internally by `actions/setup-python` to upgrade certifi) occasionally fails to deserialize across runner image versions and emits a stderr WARNING that GitHub Actions captures as an annotation.

Changes

  • `tests/python/conftest.py` — `pytest_unconfigure` hook calls `os._exit(0)` on a clean exit, bypassing CPython finalization entirely. The terminal summary and junit XML are already written by then. On failure we fall through to normal finalization so pytest's traceback machinery still surfaces.
  • `.github/workflows/ci.yml` — drops the now-dead 11-line SIGABRT/junit-XML workaround in the test step, replaces it with a plain `uv run pytest` invocation, and sets job-level `PIP_NO_CACHE_DIR=1` so any internal pip step (we use uv for actual installs) never touches the flaky cache.

Test plan

  • `uv run python -m pytest tests/python/ -v` locally — 465 passed, 9 skipped, exit 0, no `FATAL: exception not rethrown`.
  • junit XML and terminal summary preserved (`trylast`-equivalent ordering via `pytest_unconfigure`).
  • `uv run ruff check`, `uv run mypy` clean.
  • CI green on this PR (Linux/macOS/Windows test matrices).

@pratyush618 pratyush618 merged commit 1e0c63e into master Apr 30, 2026
20 checks passed
@pratyush618 pratyush618 deleted the fix/ci-pyo3-finalization-and-pip-cache-warning branch April 30, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant