hanging when I use --time-methid=signal
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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Tái hiện hiện tượng treo bằng vòng lặp pytest.main được示 và --timeout-method=signal, sau đó kiểm tra đầu ra timeout từ iree/tests/e2e/dlc_specific/test_runner.py, đặc biệt là thread_task, run_test, run_in_backend và subprocess.run. Theo dõi cách worker và subprocess bị timeout được xử lý; hoàn thành có nghĩa là một trường hợp bị timeout trả quyền điều khiển về vòng lặp và trường hợp kiểm thử tiếp theo chạy mà không khiến tiến trình bị treo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
i am making a unittest,
`for index, test_case in enumerate(test_cases[start_case_index:], start=start_case_index):
test_case_name = test_case.split("::")[-1]
print(f"Running {test_case_name}")
pytest.main(['-v', '--tb=short', '--capture=no', '--timeout=20', '--timeout-method=signal', test_case], plugins=[recorder])
result_data = recorder.results.get(test_case)
if result_data is None:
result_data = {
"outcome": "not executed",
"duration": 0,
"timestamp": datetime.now().isoformat()
}`
above is my test code, if one case is out of time, the process will hang and show log like below and would not break out to next test case,what shoukd I do?
++++++++++++++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++++++++++++
File "/usr/lib/python3.10/threading.py", line 973, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 83, in _worker
work_item.run()
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 461, in thread_task
result = run_test(fn, inputs, output_num, global_config_path,
File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 428, in run_test
output_fns1 = run_in_backend("dlc")
File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 406, in run_in_backend
run_result = subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 505, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/usr/lib/python3.10/subprocess.py", line 1154, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.10/subprocess.py", line 2021, in _communicate
ready = selector.select(timeout)
File "/usr/lib/python3.10/selectors.py", line 416, in select
fd_event_list = self._selector.poll(timeout)
++++++++++++++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++++++++++++
- 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 45 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ự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
awslabs/visual-asset-management-system#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/python-sdk#3670 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aicell-lab/bioengine#232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
modelscope/evalscope#1836 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100