[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/13] Avocado tests: allow for parallel execution of tests
From: |
Cleber Rosa |
Subject: |
[PATCH 13/13] Avocado tests: allow for parallel execution of tests |
Date: |
Fri, 26 Jul 2024 09:44:38 -0400 |
The updated Avocado version allows for the execution of tests in
parallel.
While on a CI environment it may not be a good idea to increase the
parallelization level in a single runner, developers may leverage that
on specific CI runners or on their development environments.
This also multiplies the timeout for each test accordingly. The
reason is that more concurrency can lead to less resources, and less
resources can lead to some specific tests taking longer to complete
and then time out. The timeout factor being used here is very
conservative (being equal to the amount of parallel tasks). The worst
this possibly oversized timeout value can do is making users wait a
bit longer for the job to finish if a test hangs.
Overall, users can expect a much quicker turnaround on most systems
with a value such as 8 on a 12 core machine.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
docs/devel/testing.rst | 12 ++++++++++++
tests/Makefile.include | 6 +++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 23d3f44f52..5600123743 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -983,6 +983,18 @@ of Avocado or ``make check-avocado``, and can also be
queried using:
pyvenv/bin/avocado list tests/avocado
+To run tests in parallel, the ``AVOCADO_PARALLEL`` environment
+variable can be defined with a value different than ``1`` (its default
+value). Example:
+
+ .. code::
+
+ make check-avocado AVOCADO_PARALLEL=4
+
+Please exercise care when using parallel execution with the QEMU
+Avocado tests as a higher system load can cause time sensitive tests
+to timeout and be interrupted.
+
Manual Installation
~~~~~~~~~~~~~~~~~~~
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 6618bfed70..545b5155f9 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -94,6 +94,9 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
ifndef AVOCADO_TESTS
AVOCADO_TESTS=tests/avocado
endif
+ifndef AVOCADO_PARALLEL
+ AVOCADO_PARALLEL=1
+endif
# Controls the output generated by Avocado when running tests.
# Any number of command separated loggers are accepted. For more
# information please refer to "avocado --help".
@@ -141,7 +144,8 @@ check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
--show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
$(if $(AVOCADO_TAGS),, --filter-by-tags-include-empty \
--filter-by-tags-include-empty-key) \
- $(AVOCADO_CMDLINE_TAGS) \
+ $(AVOCADO_CMDLINE_TAGS) --max-parallel-tasks=$(AVOCADO_PARALLEL) \
+ -p timeout_factor=$(AVOCADO_PARALLEL) \
$(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
"AVOCADO", "tests/avocado")
--
2.45.2
- Re: [PATCH 05/13] tests/avocado: machine aarch64: standardize location and RO access, (continued)
- [PATCH 06/13] tests/avocado: use more distinct names for assets, Cleber Rosa, 2024/07/26
- [PATCH 09/13] tests/avocado/boot_xen.py: fetch kernel during test setUp(), Cleber Rosa, 2024/07/26
- [PATCH 11/13] tests/avocado/machine_aarch64_sbsaref.py: allow for rw usage of image, Cleber Rosa, 2024/07/26
- [PATCH 08/13] testa/avocado: test_arm_emcraft_sf2: handle RW requirements for asset, Cleber Rosa, 2024/07/26
- [PATCH 13/13] Avocado tests: allow for parallel execution of tests,
Cleber Rosa <=
- [PATCH 12/13] Bump avocado to 103.0, Cleber Rosa, 2024/07/26
- [PATCH 07/13] tests/avocado/kvm_xen_guest.py: cope with asset RW requirements, Cleber Rosa, 2024/07/26
- [PATCH 10/13] tests/avocado/tuxrun_baselines.py: use Avocado's zstd support, Cleber Rosa, 2024/07/26