Skip to contentSkip to conversation

scripts/runtime.bash: Fix TIMEOUT env var override

PATCH Superseded Kevin Cheng 2 participants 4 messages Nov 17, 2025 – Nov 18, 2025 KVM

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 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
Signature · 1 line
2.52.0.rc1.455.g30608eb744-goog
#1 lore raw
Quoted 31 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.

---
 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

Forgot to CC Sean

#2 lore raw
In reply to Kevin Cheng
Quoted 5 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.

Missing sign-off.

And let's add

Fixes fd149358c491 ("run scripts: add timeout support")

even though that commit didn't document the intention at all, because I agree with the assumed intention documented with 7e62eeb72fe3 ("scripts:
Document environment variables").

Quoted 27 lines
---
 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
Signature · 1 line
2.52.0.rc1.455.g30608eb744-goog

Thanks,
drew

#3 lore raw
Quoted 10 lines · Andrew Jones
Quoted 5 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.

Missing sign-off.

Quoted 7 lines

And let's add

Fixes fd149358c491 ("run scripts: add timeout support")

even though that commit didn't document the intention at all, because I agree with the assumed intention documented with 7e62eeb72fe3 ("scripts:
Document environment variables").

Done. Thanks for pointing that out!

Quoted 30 lines
Quoted 25 lines
---
 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

Thanks,
drew