[tests] add timeout to cert suite execution (#12379)

Currently, the `run_cert()` function in `run_cert_suite.py` invokes
test scripts using `subprocess.check_call()` without a timeout. This
can cause the test suite to hang indefinitely if a test script fails
to terminate.

This commit updates `run_cert_suite.py` to support a configurable
`--timeout` argument. It passes this timeout to `check_call()` and
handles `subprocess.TimeoutExpired` to log failure and print output
upon timeout.

Additionally, this commit updates `script/test` to pass the
`TEST_TIMEOUT` environment variable to the test runner and updates
GitHub workflow configurations to define specific timeout values for
various test jobs.
This commit is contained in:
Abtin Keshavarzian
2026-02-09 11:38:18 -08:00
committed by GitHub
parent ebba0b39a5
commit 968ae74341
5 changed files with 22 additions and 6 deletions
+1 -1
View File
@@ -317,7 +317,7 @@ do_cert_suite()
sudo modprobe ip6table_filter
mkdir -p ot_testing
./tests/scripts/thread-cert/run_cert_suite.py --run-directory ot_testing --multiply "${MULTIPLY:-1}" "$@"
./tests/scripts/thread-cert/run_cert_suite.py --run-directory ot_testing --multiply "${MULTIPLY:-1}" --timeout "${TEST_TIMEOUT:-0}" "$@"
exit 0
}