[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 02/02: tests: Individual tests time out after 3 minutes.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 02/02: tests: Individual tests time out after 3 minutes. |
Date: |
Wed, 3 May 2023 06:35:26 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit d6e4f59705f8526bea320a19e00d0aca552c1270
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed May 3 12:30:49 2023 +0200
tests: Individual tests time out after 3 minutes.
This provides better diagnostics, and more quickly, when a test gets
stuck.
* configure.ac: Check for 'timeout'. Substitute 'TIMEOUT' and define
'HAVE_TIMEOUT' conditional.
* Makefile.am (SH_LOG_COMPILER) [HAVE_TIMEOUT]: New value.
---
Makefile.am | 6 ++++++
configure.ac | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index fbc6d11..d82e75c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,7 +278,13 @@ AM_TESTS_ENVIRONMENT = \
GUILE_LOAD_PATH="$(abs_top_srcdir)/modules:$(abs_top_builddir)/modules:$$GUILE_LOAD_PATH"
\
GUILE_LOAD_COMPILED_PATH="$(abs_top_srcdir)/modules:$(abs_top_builddir)/modules:$$GUILE_LOAD_COMPILED_PATH"
+if HAVE_TIMEOUT
+# Tests should never take more than a few seconds on modern machines.
+SH_LOG_COMPILER = $(TIMEOUT) 3m $(SHELL)
+else
SH_LOG_COMPILER = $(SHELL)
+endif
+
AM_SH_LOG_FLAGS = -x -e
# Make sure source files are installed first, so that the mtime of
diff --git a/configure.ac b/configure.ac
index fa0974e..31e46e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,11 @@ AC_CANONICAL_HOST
AC_PROG_MKDIR_P
AC_PROG_SED
+dnl The 'timeout' program, introduced in GNU Coreutils 7.0 (2008).
+AC_PATH_PROG([TIMEOUT], [timeout], [not-found])
+AM_CONDITIONAL([HAVE_TIMEOUT], [test "x$TIMEOUT" != "xnot-found"])
+AC_SUBST([TIMEOUT])
+
dnl Check for Guile 2.2+.
m4_pattern_forbid([^GUILE_PKG$])
GUILE_PKG([3.0 2.2])