All tests fail with 'EXITED with status 3' on pytest 9.2.0 (TestReport._id is not marshallable)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 66/100
Direzione di ricerca
Il fallimento deriva da serialize_report(), che copia TestReport.dict prima che il processo figlio lo invii con marshal.dumps(). Inizia riproducendo il problema con l'esempio test_min.py sotto pytest 9.2.0 e --forked, poi verifica quale valore del dizionario del report non può essere serializzato con marshal. Il lavoro è completo quando l'esecuzione con --forked passa sotto pytest 9.2.0 e, se si verifica un fallimento, l'eccezione del figlio viene stampata prima di os._exit(3).
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With pytest 9.2.0, every test run under --forked fails, including ones that pass, with running the test EXITED with status 3. pytest 9.1.1 works.
Reproduce
# test_min.py
def test_ok():
assert True
$ pip install pytest==9.2.0 pytest-forked==1.7.5
$ pytest --forked -q test_min.py
FAILED test_min.py::test_ok - .../test_min.py:1: running the test EXITED with status 3
1 failed
Seen on macOS (Darwin 27.2, Python 3.14.7) and on GitHub's ubuntu-latest and macOS runners.
Cause
pytest 9.2.0 adds a private _id attribute to TestReport, holding a NodeId object. serialize_report() copies rep.__dict__ and the child sends it with marshal.dumps(), which raises ValueError: unmarshallable object on NodeId. The child catches the exception and exits with EXITSTATUS_EXCEPTION (3), so the actual error is never shown.
Checking each value of serialize_report(report) with marshal.dumps shows _id (type NodeId) is the only one that fails under 9.2.0, for the setup, call and teardown reports. There are no failures under 9.1.1.
Possible fix
Drop or stringify values marshal can't handle in serialize_report(), e.g. skip private (_-prefixed) keys, or convert unknown types with str(). pytest-xdist's report serialization goes through config.hook.pytest_report_to_serialize / pytest_report_from_serialized, which pytest keeps compatible. Using those hooks would avoid depending on TestReport.__dict__ at all.
It would also help to print the child's exception (or write it to the stderr capture) before os._exit(3), so the next failure of this kind is self-explanatory.
- Lingua principale
- Python
- Stelle
- 84
- Fork
- 30
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-forked
-
`ResourceWarning`/`PytestUnraisableExceptionWarning` with version 1.7.5Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pytest-forked#106 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
pytest-dev/pytest-forked#84 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
pytest-dev/pytest-forked#111 · 2 commenti ·
-
Fork per subpathAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
pytest-dev/pytest-forked#94 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
pytest-dev/pytest-forked#88 · 12 commenti ·
Tutte le issue di pytest-dev/pytest-forked
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
earthtojake/text-to-cad#758 ·
I maintainer di solito rispondono entro 1 giorno
-
domain:upgrades enhancement needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
gke-labs/kube-agents#4634 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
agardnerIT/opamp-server-py#116 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
elviskahoro/sdk-python-attio#144 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno