hundreds-father-404
05/27/2021, 7:44 PMpex_tests.py
. I suspect this is from contention - 60 seconds is more than enough for import_parser_test.py
, for example, which is 16.4s on my machine ๐งตhundreds-father-404
05/27/2021, 7:45 PM--process-execution-local-parallelism
defaults to 2. Meaning we have 2 Pytest processes at the same time. Within each Pytest process, tests run sequentially.
So I don't expect a wild number of processes at once? Generally, each individual test only spawns 1-2 processeshundreds-father-404
05/27/2021, 7:47 PM--process-execution-local-parallelism
to 1? Meaning we lose all parallelism in CI ๐
Bumping the timeout to >60 seconds for a test that takes 16s locally smells wrongenough-analyst-54434
05/27/2021, 8:10 PMenough-analyst-54434
05/27/2021, 8:14 PMenough-analyst-54434
05/27/2021, 8:22 PM$ python3.8 -c 'import multiprocessing, os; print(f"multiprocessing: {multiprocessing.cpu_count()} os: {os.cpu_count()} sched: {len(os.sched_getaffinity(0))}")'
multiprocessing: 8 os: 8 sched: 8
Versus:
$ docker run --cpuset-cpus 0 --rm python:3.8 python -c 'import multiprocessing, os; print(f"multiprocessing: {multiprocessing.cpu_count()} os: {os.cpu_count()} sched: {len(os.sched_getaffinity(0))}")'
multiprocessing: 8 os: 8 sched: 1
enough-analyst-54434
05/27/2021, 8:24 PM--cpus 1
only sets a utilization limit of 1 and python still sees 8 via all three methods.hundreds-father-404
05/27/2021, 8:25 PMIOW, we have pants at the outer layer using 2 cores, but what happens when we launch 2 ITs on those two slots?Ah, good point
The latter is correct when containers are involved.Will fix
[python-setup]
nowenough-analyst-54434
05/28/2021, 5:16 PMhundreds-father-404
05/28/2021, 5:17 PMenough-analyst-54434
05/28/2021, 5:17 PMenough-analyst-54434
05/28/2021, 5:18 PMClearly 1 for resolves worksBecause
pex -j1
works - no trickery in that impl.hundreds-father-404
05/28/2021, 5:19 PM--rule-threads-core
? We enforce it's >=2 to avoid deadlocks with interactive processes and goal rulesenough-analyst-54434
05/28/2021, 5:19 PMenough-analyst-54434
05/28/2021, 5:19 PMhundreds-father-404
05/28/2021, 5:19 PM_EXECUTOR = PyExecutor(
core_threads=multiprocessing.cpu_count(), max_threads=multiprocessing.cpu_count() * 4
)
enough-analyst-54434
05/28/2021, 5:20 PMenough-analyst-54434
05/28/2021, 5:23 PMenough-analyst-54434
05/28/2021, 5:23 PMhundreds-father-404
06/03/2021, 11:55 PMhundreds-father-404
07/02/2021, 6:47 PM