[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
+2
View File
@@ -50,6 +50,7 @@ jobs:
env:
REFERENCE_DEVICE: 1
VIRTUAL_TIME: 0
TEST_TIMEOUT: 1800
PACKET_VERIFICATION: 1
THREAD_VERSION: 1.4
INTER_OP: 1
@@ -165,6 +166,7 @@ jobs:
env:
REFERENCE_DEVICE: 1
VIRTUAL_TIME: 0
TEST_TIMEOUT: 1800
PACKET_VERIFICATION: ${{ matrix.packet_verification }}
THREAD_VERSION: 1.4
INTER_OP: 1
+5
View File
@@ -52,6 +52,7 @@ jobs:
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
MULTIPLY: 3
steps:
@@ -107,6 +108,7 @@ jobs:
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
steps:
- name: Harden Runner
@@ -162,6 +164,7 @@ jobs:
THREAD_VERSION: 1.1
USE_MTD: 1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
MESSAGE_USE_HEAP: ${{ matrix.message_use_heap }}
steps:
@@ -212,6 +215,7 @@ jobs:
REFERENCE_DEVICE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
steps:
- name: Harden Runner
@@ -361,6 +365,7 @@ jobs:
COVERAGE: 1
THREAD_VERSION: 1.1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
CXXFLAGS: "-DOPENTHREAD_CONFIG_LOG_PREPEND_UPTIME=0"
steps:
+2
View File
@@ -55,6 +55,7 @@ jobs:
COVERAGE: 1
THREAD_VERSION: 1.4
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
INTER_OP: 1
INTER_OP_BBR: 1
@@ -125,6 +126,7 @@ jobs:
env:
REFERENCE_DEVICE: 1
VIRTUAL_TIME: 1
TEST_TIMEOUT: 300
OT_VT_USE_UNIX_SOCKET: 1
COVERAGE: 1
PACKET_VERIFICATION: 1