1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Improve handling of not-parallel test runs

* test/Makefile.in: Distinguish between parallel and not-parallel
tests.  Mark lisp/autorevert-tests.log, lisp/filenotify-tests.log
and lisp/net/tramp-tests.log to run not-parrallel.  (Bug#80164)

* test/README: Some of the tests do not run parallel when
expensive tests are activated.

* test/infra/gitlab-ci.yml (.job-template): Use "make -j".
Makefile knows how to handle parallel runs properly.
This commit is contained in:
Michael Albinus 2026-01-24 09:07:46 +01:00
parent 3573116d3e
commit 6762394734
3 changed files with 22 additions and 6 deletions

View file

@ -219,8 +219,13 @@ LOGFILES := $(patsubst %.el,%.log, \
TESTS := $(LOGFILES:.log=)
## Some tests show problems when run in parallel with other tests.
## Suppress parallelism for them.
.NOTPARALLEL: lisp/filenotify-tests.log lisp/net/tramp-tests.log
## Suppress parallelism for them when SELECTOR is equal to
## SELECTOR_EXPENSIVE or SELECTOR_ALL.
PARALLEL_TESTS := $(LOGFILES)
ifeq ($(subst $(SELECTOR_ALL),yes,$(subst $(SELECTOR_EXPENSIVE),yes,$(SELECTOR_ACTUAL))), yes)
$(eval NOT_PARALLEL_TESTS := $(filter lisp/autorevert-tests.log lisp/filenotify-tests.log lisp/net/tramp-tests.log, $(LOGFILES)))
$(eval PARALLEL_TESTS := $(filter-out $(NOT_PARALLEL_TESTS), ${LOGFILES}))
endif
## If we have to interrupt a hanging test, preserve the log so we can
## see what the problem was.
@ -352,7 +357,12 @@ ifeq ($(TEST_INTERACTIVE), yes)
$(patsubst %,-l %,$(if $(findstring $(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=))) \
$(TEST_RUN_ERT)
else
-@${MAKE} -k ${LOGFILES}
ifdef NOT_PARALLEL_TESTS
-@${MAKE} -k -j1 ${NOT_PARALLEL_TESTS}
endif
ifdef PARALLEL_TESTS
-@${MAKE} -k ${PARALLEL_TESTS}
endif
@$(emacs) --batch -l ert --eval \
"(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES}
endif

View file

@ -35,7 +35,9 @@ test" instead.
Running several tests in parallel could result in unexpected side
effects with ephemeral test errors. Therefore, it is recommend not to
use "make -j".
use "make -j". Nonetheless, when expensive tests are activated, some of
the tests do not run parallel anyway. See make variable
$NOT_PARALLEL_TESTS.
The Makefile sets the environment variable $EMACS_TEST_DIRECTORY,
which points to this directory. This environment variable does not
@ -97,6 +99,9 @@ use it directly:
make <filename> SELECTOR='test-foo-remote'
Setting $SELECTOR in combination with the check-expensive or check-all
make targets is ignored.
Note that although the test files are always compiled (unless they set
no-byte-compile), the source files will be run when expensive or
unstable tests are involved, to give nicer backtraces. To run the

View file

@ -90,6 +90,7 @@ default:
-e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT}
-e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT}
-e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE}
-e NPROC=`nproc`
-e http_proxy=${http_proxy}
-e https_proxy=${https_proxy}
-e no_proxy=${no_proxy}
@ -103,8 +104,8 @@ default:
git diff --name-only FETCH_HEAD &&
( git diff --name-only FETCH_HEAD |
xargs git checkout -f FETCH_HEAD ) &&
make &&
make -k ${make_params}"'
make -j \$NPROC &&
make -k -j \$NPROC ${make_params}"'
after_script:
# - docker ps -a
# - pwd; printenv