This sounds like a challenging feature.  Assuming that issues like the process tree being reaped can be dealt with, have you considered how to deal with the possible carnage (e.g. temporary files or even something like system networking left in a bad state) which may occur if a test is forcibly stopped?  If a test is not allowed to clean up, then it may fail later due to an unexpected state when 'make test' is run again.

Bob

On POSIX systems, I assume that the SIGTERM signal is used.  Is there a reliable mechanism under Microsoft Windows?

Bob

On 10/23/26 10:31, Kamila Szewczyk wrote:
Dear all,

I am planning to add a new feature.  It allows one to specify the timeout in tests in seconds like so:

TESTS = fast.sh slow.sh long.sh
AM_TEST_TIMEOUT = 2
AM_TEST_TIMEOUTS = long.sh:10      # matched like XFAIL_TESTS

Some design constraints: it has to work on bmake, GNU make and other exotic makes; `make check TEST_TIMEOUT=0' disables the timeouts (or sets another value globally in seconds...). Then, a test timeout is correctly reported as ERROR or FAIL (depending on DISABLE_HARD_ERRORS).

Some problems that I am currently working out: I think that on timeout, the entire process tree should be reaped. Unfortunately, zsh can't do job control in non-interactive shells. I also noticed some issues with interactive programs + AM_TEST_TIMEOUT (although, this is probably an unrealistic edge case).

Do you have any suggestions on this?  I will try to wrap up the code and push it tomorrow.  I find myself copy-pasting this feature over and over in my Automake scripts, as seen in e.g. https://github.com/iczelia/balrogg/blob/trunk/Makefile.am.

--
With Valediction,
Kamila Szewczyk (https://iczelia.net)

Reply via email to