Mesa (main): ci/bare-metal: Add timeouts to the shell commands called in fastboot.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 19 21:56:43 UTC 2022
Module: Mesa
Branch: main
Commit: cde8c92ab6d90b729eace99626045f635deb30cd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cde8c92ab6d90b729eace99626045f635deb30cd
Author: Emma Anholt <emma at anholt.net>
Date: Mon Jul 18 14:16:05 2022 -0700
ci/bare-metal: Add timeouts to the shell commands called in fastboot.
It seems that we sometimes stall out executing "fastboot boot", and if
that happens we want to reboot the board and try again.
Fixes: #6682
Acked-by: David Heidelberg <david.heidelberg at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17607>
---
.gitlab-ci/bare-metal/fastboot_run.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/.gitlab-ci/bare-metal/fastboot_run.py b/.gitlab-ci/bare-metal/fastboot_run.py
index 8721515b100..fe0d60ba5bd 100755
--- a/.gitlab-ci/bare-metal/fastboot_run.py
+++ b/.gitlab-ci/bare-metal/fastboot_run.py
@@ -22,7 +22,7 @@
# IN THE SOFTWARE.
import argparse
-import os
+import subprocess
import re
from serial_buffer import SerialBuffer
import sys
@@ -46,13 +46,17 @@ class FastbootRun:
NO_COLOR = '\033[0m'
print(RED + message + NO_COLOR)
- def logged_system(self, cmd):
+ def logged_system(self, cmd, timeout=60):
print("Running '{}'".format(cmd))
- return os.system(cmd)
+ try:
+ return subprocess.call(cmd, shell=True, timeout=timeout)
+ except subprocess.TimeoutExpired:
+ self.print_error("timeout, restarting run...")
+ return 2
def run(self):
- if self.logged_system(self.powerup) != 0:
- return 1
+ if ret := self.logged_system(self.powerup):
+ return ret
fastboot_ready = False
for line in self.ser.lines(timeout=2 * 60, phase="bootloader"):
@@ -71,8 +75,8 @@ class FastbootRun:
"Failed to get to fastboot prompt, restarting run...")
return 2
- if self.logged_system(self.fastboot) != 0:
- return 1
+ if ret := self.logged_system(self.fastboot):
+ return ret
print_more_lines = -1
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
More information about the mesa-commit
mailing list