All tests fail with 'EXITED with status 3' on pytest 9.2.0 (TestReport._id is not marshallable)
まだ誰も着手していません。
評価
調査の方向性
失敗の原因は serialize_report() にあり、子プロセスが marshal.dumps() で送信する前に TestReport.dict をコピーしています。まず pytest 9.2.0 と --forked の下で test_min.py の例を使って再現し、レポートの dict のどの値が marshal でシリアライズできないのかを確認してください。完了の条件は、pytest 9.2.0 の下で forked 実行が成功すること、そして実際に失敗が発生した場合に子プロセスの例外が os._exit(3) の前に出力されることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 84
- フォーク
- 30
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-forked のほかの issue
-
`ResourceWarning`/`PytestUnraisableExceptionWarning` with version 1.7.5再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pytest-dev/pytest-forked#106 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
pytest-dev/pytest-forked#84 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
pytest-dev/pytest-forked#111 · コメント 2 件 ·
-
Fork per subpathオープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-forked#94 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
pytest-dev/pytest-forked#88 · コメント 12 件 ·
pytest-dev/pytest-forked の issue をすべて見る
似ている issue
-
bump patch
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
QuantConnect/Documentation#2838 ·
メンテナーはふだん 1 日以内に返信
-
get_all_subclasses must deduplicate by class identity対応中かも @Gambit-Checkmate が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 15 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · コメント 1 件 ·