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? Kevin