Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
| -rw-r--r-- | tests/setup.sh | 5 |
1 file changed, 4 insertions, 1 deletion
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 |
