subprocess not killed when timeout fires
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- operating-systems, testing-qa
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cơ chế xử lý timeout của pytest-timeout và cách nó kết thúc pytest trên Windows; issue không nêu tệp nguồn hay bài kiểm thử nào. Sau đó, tái hiện kịch bản subprocess.Popen được mô tả trong issue, rồi xác minh rằng một bài kiểm thử bị timeout không để lại tiến trình con nào và job GitLab kết thúc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I've been using pytest-timeout for some time to catch whenever we have bad tests that just hang for a long time.
This doesn't happen very often and most of the time it happens locally and pytest-timeout saves the day.
We've been having an issue for some time when we run our tests in GitLab CI and a test ends up running for too long and then it's killed by pytest-timeout, The GitLab job hangs and eventually the GitLab runner crashes.
I debugged it today both locally and on GitLab and the issue I found is that we have a fixture where we open a server application using subprocess.Popen().
In the case where one of our tests takes too long and pytest is killed by pytest-timeout the subprocess remains open in the background.
Locally this isn't an issue because we cleanup any hanging processes at the start of our tests so they don't affect subsequent tests.
However in GitLab the job doesn't finish until all the processes are closed. Because the parent process is closed the GitLab runner isn't able to find any of the child processes and close those and everything hangs.
I'm running on Windows by the way.
So to get to my question, is there a way I can ensure that when pytest-timeout fires and kills pytest that it also kills any open subprocesses?
Thank you,
Alex
- Ngôn ngữ chính
- Python
- Star
- 260
- Fork
- 70
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytest-dev/pytest-timeout
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versionsCó thể đã có người làm @Sanjays2402 đã nhận 44 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
pytest-dev/pytest-timeout#203 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pytest-dev/pytest-timeout#190 · 9 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pytest-dev/pytest-timeout#189 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
pytest-dev/pytest-timeout#181 · 4 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
pytest-dev/pytest-timeout#178 · 1 bình luận ·
Tất cả issue của pytest-dev/pytest-timeout
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
UKGovernmentBEIS/inspect_ai#5802 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
no-human-ai/no_human#660 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a Security Insights v2 fileĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation need help question
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 66/100
phonology024/babelscribe#26 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100