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

Đang mở
#6,294 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
40/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, python
Lĩnh vực
testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🤖 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.

Ngôn ngữ chính
C++
Star
18k
Fork
2.3k
Merge trung bình
5 ngày 7 giờ
Pull request đã merge (30 ngày)
53

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pybind/pybind11

Tất cả issue của pybind/pybind11

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.