Am 10.12.2021 um 15:46 hat Vladimir Sementsov-Ogievskiy geschrieben: > 10.12.2021 17:36, Kevin Wolf wrote: > > Am 03.12.2021 um 13:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > Add -j <JOBS> parameter, to run tests in several jobs simultaneously. > > > For realization - simply utilize multiprocessing.Pool class. > > > > > > Notes: > > > > > > 1. Of course, tests can't run simultaneously in same TEST_DIR. So, > > > use subdirectories TEST_DIR/testname/ and SOCK_DIR/testname/ > > > instead of simply TEST_DIR and SOCK_DIR > > > > > > 2. multiprocessing.Pool.starmap function doesn't support passing > > > context managers, so we can't simply pass "self". Happily, we need > > > self only for read-only access, and it just works if it is defined > > > in global space. So, add a temporary link TestRunner.shared_self > > > during run_tests(). > > > > > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > > > > Just wondering, is it worth even supporting the mp=false case or can we > > simplify the code a bit by always going through multiprocessing and > > using nice directory names even if only one process is spawned? > > > > Maybe John's observation that directory names get longer might be a > > reason not to do that by default. Any other reasons you're aware of? > > I just wanted to keep the behavior without a new option unchanged, to > not deal with possible CI failures on "make check": who know what > multiprocessing brings together with performance.
So basically just err on the side of caution. Makes sense. Kevin