Skip to contentSkip to conversation

scripts/runtime.bash: Fix TIMEOUT env var override

PATCH In review Kevin Cheng 2 participants 2 messages Nov 18, 2025 KVM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scripts/runtime.bash: Fix TIMEOUT env var override

According to unittests.txt timeout deinition, the TIMEOUT environment variable should override the optional timeout specified in unittests.cfg. Fix this by defaulting the timeout in run() to the TIMEOUT env var, followed by the timeout in unittests.cfg, and lastly by the previously defined default of 90s.

Fixes fd149358c491 ("run scripts: add timeout support")
---
 scripts/runtime.bash | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/runtime.bash +1 -2
index 6805e97f90c8f..0704a390bfe1e 100644
@@ -1,6 +1,5 @@
 : "${RUNTIME_arch_run?}"
 : "${MAX_SMP:=$(getconf _NPROCESSORS_ONLN)}"
-: "${TIMEOUT:=90s}"
 
 PASS() { echo -ne "\e[32mPASS\e[0m"; }
 SKIP() { echo -ne "\e[33mSKIP\e[0m"; }
@@ -82,7 +81,7 @@ function run()
     local machine="$8"
     local check="${CHECK:-$9}"
     local accel="${10}"
-    local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default
+    local timeout="${TIMEOUT:-${11:-90s}}" # TIMEOUT env var overrides unittests.cfg
     local disabled_if="${12}"
 
     if [ "${CONFIG_EFI}" == "y" ]; then

--
2.52.0.rc1.455.g30608eb744-goog

#1 lore raw
Quoted 33 lines · Kevin Cheng

According to unittests.txt timeout deinition, the TIMEOUT environment variable should override the optional timeout specified in unittests.cfg. Fix this by defaulting the timeout in run() to the TIMEOUT env var, followed by the timeout in unittests.cfg, and lastly by the previously defined default of 90s.

Fixes fd149358c491 ("run scripts: add timeout support")
---
 scripts/runtime.bash | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/runtime.bash +1 -3
index 6805e97f90c8f..0704a390bfe1e 100644
@@ -1,6 +1,5 @@
 : "${RUNTIME_arch_run?}"
 : "${MAX_SMP:=$(getconf _NPROCESSORS_ONLN)}"
-: "${TIMEOUT:=90s}"
 
 PASS() { echo -ne "\e[32mPASS\e[0m"; }
 SKIP() { echo -ne "\e[33mSKIP\e[0m"; }
@@ -82,7 +81,7 @@ function run()
     local machine="$8"
     local check="${CHECK:-$9}"
     local accel="${10}"
-    local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default
+    local timeout="${TIMEOUT:-${11:-90s}}" # TIMEOUT env var overrides unittests.cfg
     local disabled_if="${12}"
 
     if [ "${CONFIG_EFI}" == "y" ]; then
--
Quoted 2 lines

2.52.0.rc1.455.g30608eb744-goog

Merged.

Thanks,
drew