python / python/cpython

Tests using the same machine-wide resource should not run in parallel

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

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

tests type-feature
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ả

Feature or enhancement

Some resources which tests use are not per-process: the display, the sound device, the terminal. Two tests using one of them at the same time can interfere with each other, and regrtest runs test files in parallel by default.

Only tests using the same resource conflict. A GUI test can run in parallel with any non-GUI test, so pausing all the other tests would be too much.

These resources are already named on the command line: gui, audio, console and curses. A test declares which one it needs with requires(), requires_resource() or, for the memory, bigmemtest(), so those functions could lock the resource for the duration of the test or of the test file. The ~50 GUI modules, test_winsound, test_curses, test_winconsoleio and the bigmem tests would need no change.

The cost is that such tests no longer overlap each other: running test_tkinter, test_ttk and test_idle with -j4 takes as long as all three together (7.1 s here) instead of as long as the slowest (3.5 s). Tests which use no such resource keep running in parallel with them.

Linked PRs
  • gh-156902

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu với regrtest và các khai báo tài nguyên được nêu trong issue: requires(), requires_resource() và bigmemtest(). Xem lại cách các bài kiểm thử GUI, audio, console, curses và bigmem hiện khai báo tài nguyên, sau đó xác minh rằng các bài kiểm thử dùng chung một tài nguyên không còn chồng lấn lên nhau, trong khi các bài kiểm thử không liên quan vẫn chạy song song.

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
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
30/100

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.