Commit Graph

8 Commits

Author SHA1 Message Date
Kyle Edwards
0e8584c89c CTest: Fix regression in calculating test timeout
Fixes: #25120
2023-07-24 19:29:54 -04:00
Brad King
54c5654f7d ctest: Optionally terminate tests with a custom signal on timeout
CTest normally terminates test processes on timeout using `SIGKILL`.
Offer tests a chance to exit gracefully, on platforms supporting POSIX
signals, by setting `TIMEOUT_SIGNAL_{NAME,GRACE_PERIOD}` properties.

Fixes: #17288
2023-06-02 06:51:13 -04:00
Brad King
3edf7fbb41 ctest: Fix TIMEOUT test property with value 0 with --timeout flag
An explicit zero TIMEOUT test property value should not be overridden by
the `--timeout` flag.
2023-05-04 16:58:03 -04:00
Brad King
39a20a56dd Tests: Move CTestTestZeroTimeout into RunCMake.CTestTimeout 2023-05-04 16:58:03 -04:00
Raul Tambre
3f7ebf9354 RunCMake/CTestTimeout: Include sched.h for pid_t
ISO C modes in Clang don't enable modern POSIX standards.
Include sched.h to define pid_t in such modes.
2022-06-27 20:34:53 +03:00
Brad King
7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open
Since commit d1976cd1f2 (CTest: Fix timeout when grandchild keeps pipes
open, 2020-01-13, v3.17.0-rc1~169^2) we no longer hang, but the test
duration we report after the timeout is the amount of time the immediate
child ran before exiting.  Fix the logic to instead report the actual
amount of time we spent monitoring the test before the timeout.

Fixes: #20509
2020-03-26 14:35:54 -04:00
Brad King
d1976cd1f2 CTest: Fix timeout when grandchild keeps pipes open
When a test's process creates its own child and exits, the grandchild
may keep pipes open.  Fix CTest logic to correctly timeout if the
grandchild does not exit and close the pipes before the timeout expires.
This was broken by commit b5e21d7d2e (CTest: Re-implement test process
handling using libuv, 2017-12-10, v3.11.0-rc1~117^2) which added an
unnecessary condition to the timeout handling.

Fixes: #20116
2020-01-14 10:29:05 -05:00
Brad King
2f5eb1800b Tests: Add RunCMake.CTestTimeout test
This test will consolidate CTest timeout-related tests.
2020-01-14 10:28:51 -05:00