summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing/TdcResults.py
diff options
context:
space:
mode:
authorPedro Tammela <pctammela@mojatatu.com>2023-09-19 10:54:03 -0300
committerPaolo Abeni <pabeni@redhat.com>2023-09-28 09:51:07 +0200
commitac9b8293096465914c1a0b778e759333ceac5cd1 (patch)
treeda5a7a8dcbb416a71f25be5b69b6702e84502c18 /tools/testing/selftests/tc-testing/TdcResults.py
parentd227cc0b1ee12560f7489239fc69ba6a10b14607 (diff)
downloadlinux-stable-ac9b8293096465914c1a0b778e759333ceac5cd1.tar.gz
linux-stable-ac9b8293096465914c1a0b778e759333ceac5cd1.tar.bz2
linux-stable-ac9b8293096465914c1a0b778e759333ceac5cd1.zip
selftests/tc-testing: implement tdc parallel test run
Use a Python process pool to run the tests in parallel. Not all tests can run in parallel, for instance tests that are not namespaced and tests that use netdevsim, as they can conflict with one another. The code logic will split the tests into serial and parallel. For the parallel tests, we build batches of 32 tests and queue each batch on the process pool. For the serial tests, they are queued as a whole into the process pool, which in turn executes them concurrently with the parallel tests. Even though the tests serialize on rtnl_lock in the kernel, this feature showed results with a ~3x speedup on the wall time for the entire test suite running in a VM: Before - 4m32.502s After - 1m19.202s Examples: In order to run tdc using 4 processes: ./tdc.py -J4 <...> In order to run tdc using 1 process: ./tdc.py -J1 <...> || ./tdc.py <...> Note that the kernel configuration will affect the speed of the tests, especially if such configuration slows down process creation and/or fork(). Tested-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/testing/selftests/tc-testing/TdcResults.py')
-rw-r--r--tools/testing/selftests/tc-testing/TdcResults.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/tc-testing/TdcResults.py b/tools/testing/selftests/tc-testing/TdcResults.py
index 1e4d95fdf8d0..e56817b97f08 100644
--- a/tools/testing/selftests/tc-testing/TdcResults.py
+++ b/tools/testing/selftests/tc-testing/TdcResults.py
@@ -59,7 +59,8 @@ class TestResult:
return self.steps
class TestSuiteReport():
- _testsuite = []
+ def __init__(self):
+ self._testsuite = []
def add_resultdata(self, result_data):
if isinstance(result_data, TestResult):