[BUG]: test_iostream is flaky on Windows (capfd captures empty output)

オープン
#6,294 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, python
領域
testing

調査の方向性

Start in tests/test_iostream.py at test_redirect, test_redirect_err, test_redirect_reentry and test_err, the four cases named in the two failing jobs, and read the raw_output binding they call into before touching anything. Reproduce on a Windows runner (windows-2022, MSVC 2022 C++20, x64) with pytest tests/test_iostream.py run repeatedly, since the failure is intermittent and the cause is not yet known. Done means those tests stop returning empty output from capfd.readouterr() across repeated Windows CI runs; treat this as investigation first, so the outcome may be a fix in the test, the binding, or both.

索引モデルが issue の本文から書いたものです。

説明

🤖 AI text below 🤖

tests/test_iostream.py fails intermittently on Windows CI. capfd.readouterr() returns an empty string for output written directly to std::cout / std::cerr. The failures are not related to the changes under test.

Occurrences:

  • PR #1043, 🐍 3.9 • MSVC 2022 C++20 • x64: test_redirect, test_redirect_err, test_redirect_reentry (job)
  • master at 0066b394 (scheduled run, 2026-11-18), ⚡ (windows-2022, 3.13): test_err (job)

Example:

    def test_redirect(capfd):
        msg = "Should not be in log!"
        stream = StringIO()
        with redirect_stdout(stream):
            m.raw_output(msg)
        stdout, _stderr = capfd.readouterr()
>       assert stdout == msg
E       AssertionError: assert '' == 'Should not be in log!'

All assertions that fail are on unredirected C++ stream output read through capfd. The cause is not known.

主要言語
C++
スター
18k
フォーク
2.3k
平均マージ
5日 7時間
マージ済み PR(30日)
53

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pybind/pybind11 のほかの issue

pybind/pybind11 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。