tempest: Make concurrency configurable with a sane default.

Tempest will by default run with a concurrency matching the
number of cores on the test runner.

When running on a workstation, it is likely that the default
concurrency will be too high for the scale of deployed workload.

Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
This commit is contained in:
Frode Nordahl
2023-10-01 08:52:51 +02:00
parent 89ef6faadb
commit bf452c39e4

View File

@@ -69,6 +69,16 @@ class TempestTestBase():
tempest_options.extend(
['--exclude-regex',
' '.join([reg for reg in config.get('exclude-regex')])])
# Tempest will by default run with a concurrency matching the
# number of cores on the test runner.
#
# When running on a workstation, it is likely that the default
# concurrency will be too high for the scale of deployed workload.
#
# Make concurrency configurable with a sane default.
tempest_options.extend(
['--concurrency',
str(config.get('concurrency', min(os.cpu_count(), 4)))])
with tempfile.TemporaryDirectory() as tmpdirname:
if config.get('include-list'):
include_file = os.path.join(tmpdirname, 'include.cfg')