Tests using the same machine-wide resource should not run in parallel
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with regrtest and the resource declarations named in the issue: requires(), requires_resource(), and bigmemtest(). Review how the GUI, audio, console, curses, and bigmem tests currently declare resources, then verify that tests sharing a resource no longer overlap while unrelated tests still run in parallel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100