ITADN

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

#156082Openserhiy-storchaka 创建于 1 天前
type-featuretests
# 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.
4 条评论