multi – Parallel Test Execution

Provides additional TestRunner() classes that implement various parallel operation modes to run tests.

For most moderate deployments, running tests in serial will out perform any of the methods provided here. However, because the workloads of tests are not uniform, and good test performance is crucial for usability, dtf provides these options, largely for testing and research.

class multi.EventTestRunner(test_paths=[], pool_size=2)

Uses the Pool() class to run tests in parallel using gevent and greenlets. Typically this modality has only minor additional overhead in addition to running tests in serial, but may provide the same benefits as ThreadedTestRuner() with lower overhead.

run()

Runs all tests in queue using a pool of greenlets to run tests concurrently.

class multi.PoolTestRunner(test_paths=[], pool_size=2)

A MultiTestRunner() sub-class that initializes a single additional attribute for configuring thread or worker pools.

Used as a base class for the test runners with parallel test execution. Lacks a run()`() method.

pool_size = None

The size of the worker thread pool used to run tests.

class multi.ProcessTestRunner(test_paths=[], pool_size=2)

Uses the Pool() class within the standard multiprocessing module to run tests in parallel. Functionally equivelent to ThreadedTestRunner(), without the fallback possibility.

Theoretically the multiprocessing approach has more overhead than threading; however, in cases where the performance bottlenecks are due to the interpreter lock, this approach may afford better performance.

run()

Runs all tests in queue using a pool of independent Python processes to run all tests concurrently.

class multi.ThreadedTestRunner(test_paths=[], pool_size=2)

Uses the threadpool module to run a suite of tests with a pool of threads. This is the ideal modality for suites with workloads that spend the most of the time reading files and computing hashes, which may be common for some suites. See ProcessTestRunner() for an alternate parallelism strategy.

run()

Runs all tests in the queue list using a thread pool to run all tests concurrently.