]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/tc-testing: implement tdc parallel test run
authorPedro Tammela <pctammela@mojatatu.com>
Tue, 19 Sep 2023 13:54:03 +0000 (10:54 -0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Sep 2023 07:51:07 +0000 (09:51 +0200)
commitac9b8293096465914c1a0b778e759333ceac5cd1
treeda5a7a8dcbb416a71f25be5b69b6702e84502c18
parentd227cc0b1ee12560f7489239fc69ba6a10b14607
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>
tools/testing/selftests/tc-testing/TdcResults.py
tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py
tools/testing/selftests/tc-testing/tdc.py