From ef53a3f8783874072a523cf91cf7908a07b71b23 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 08:25:29 -1000 Subject: Put a time limit on each request in the tests A regression that blocked, such as a lock never let go or a filter that never returns, hung make test rather than failing it. The alarm is set in Perl, which the test library already wants for its chain lint, since a pending alarm survives the exec into cgit. --- tests/setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/setup.sh') diff --git a/tests/setup.sh b/tests/setup.sh index a404ac0..bd8b4c4 100644 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -254,8 +254,11 @@ cgitrc_copy() { # Runs cgit on the config file named first for the query string named second, # passing on its output and its exit status, which is 0 for an error page too. +# A request that hangs, on a lock never let go say, is killed by an alarm, +# which survives the exec, so its test fails rather than the run stalling. cgit_rc() { - CGIT_CONFIG="$PWD/$1" QUERY_STRING="$2" cgit + CGIT_CONFIG="$PWD/$1" QUERY_STRING="$2" \ + "$PERL_PATH" -e 'alarm shift; exec @ARGV or die "$ARGV[0]: $!\n"' 60 cgit } # These two ask the shared config, which keeps each page in a cache keyed on -- cgit 2.12.1