matchfile Worker bug argument list too long when using matchfile to run many tests
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Bug report
Bug description:
In https://github.com/python/cpython/issues/138313#issuecomment-3264096281, I'm trying to select different subsets of test_importlib to determine which ones are implicated in the failures. Unfortunately, it seems that when extracting the list of tests and then passing that to --matchfile the execution fails with:
+ ./python -u -W error -bb -E -m test --fast-ci --junit-xml test-results.xml test_importlib --matchfile cases.txt --dont-add-python-opts
Using random seed: 893560730
0:00:00 load avg: 0.54 Run 1 test in parallel using 1 worker process (timeout: 10 min, worker timeout: 15 min)
Warning -- regrtest worker thread failed: Traceback (most recent call last):
Warning -- File "/home/stan/cpython/Lib/test/libregrtest/run_workers.py", line 403, in run
Warning -- mp_result = self._runtest(test_name)
Warning -- File "/home/stan/cpython/Lib/test/libregrtest/run_workers.py", line 363, in _runtest
Warning -- retcode, tmp_files = self.run_tmp_files(worker_runtests,
Warning -- ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
Warning -- stdout_file.fileno())
Warning -- ^^^^^^^^^^^^^^^^^^^^^
Warning -- File "/home/stan/cpython/Lib/test/libregrtest/run_workers.py", line 299, in run_tmp_files
Warning -- retcode = self._run_process(worker_runtests,
Warning -- stdout_fd, tmp_dir)
Warning -- File "/home/stan/cpython/Lib/test/libregrtest/run_workers.py", line 180, in _run_process
Warning -- popen = create_worker_process(runtests, output_fd, tmp_dir)
Warning -- File "/home/stan/cpython/Lib/test/libregrtest/worker.py", line 73, in create_worker_process
Warning -- return subprocess.Popen(cmd, **kwargs)
Warning -- ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
Warning -- File "/home/stan/cpython/Lib/subprocess.py", line 1037, in __init__
Warning -- self._execute_child(args, executable, preexec_fn, close_fds,
Warning -- ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning -- pass_fds, cwd, env,
Warning -- ^^^^^^^^^^^^^^^^^^^
Warning -- ...<5 lines>...
Warning -- gid, gids, uid, umask,
Warning -- ^^^^^^^^^^^^^^^^^^^^^^
Warning -- start_new_session, process_group)
Warning -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning -- File "/home/stan/cpython/Lib/subprocess.py", line 1969, in _execute_child
Warning -- raise child_exception_type(errno_num, err_msg, err_filename)
Warning -- OSError: [Errno 7] Argument list too long: '/home/stan/cpython/python'
== Tests result: FAILURE, WORKER BUG ==
It seems there's a limit to the number of lines that can be passed to a --matchfile.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Hướng dẫn đóng góp
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.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lệnh với một cases.txt lớn, sau đó kiểm tra Lib/test/libregrestest/run_workers.py và Lib/test/libregrestest/worker.py xung quanh phần tạo tiến trình worker. Theo dõi cách lựa chọn --matchfile đến được subprocess.Popen và xác định việc hoàn thành là chạy lựa chọn lớn mà không gặp OSError: [Errno 7] Argument list too long.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- testing-qa
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100