]> git.proxmox.com Git - mirror_qemu.git/commit
iotests: check: multiprocessing support
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 3 Dec 2021 12:22:23 +0000 (13:22 +0100)
committerHanna Reitz <hreitz@redhat.com>
Wed, 22 Dec 2021 15:29:48 +0000 (16:29 +0100)
commit722f87df2545b308aec49b459b028f0802b4fd9e
tree15bfb3416aefe1aca10d113104f68ab16144207e
parent1f257b70d143d6c3330e6194bd977483c5f61b9b
iotests: check: multiprocessing support

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 <vsementsov@virtuozzo.com>
Message-Id: <20211203122223.2780098-4-vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Tested-by: John Snow <jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
tests/qemu-iotests/check
tests/qemu-iotests/testrunner.py