summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrea Grandi <agrandi@google.com>2023-01-09 16:21:55 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-10 22:52:09 +0000
commit210cb0c8729f4187a6bad89e7d3ece8c419433ea (patch)
tree1a15cf5347e68c664aad48e52872f28c7410dff8 /test
parentf0436fe4c66f1a6759c2ae28157ec495b53eab9c (diff)
downloadchrome-ec-210cb0c8729f4187a6bad89e7d3ece8c419433ea.tar.gz
run_device_tests.py: Handle UnicodeDecodeError
In some tests, the FPMCU ouputs log messages that are causing UnicodeDecodeError exceptions because they cannot be decoded. Instead of crashing the test, handle these exception more gracefully by printing the FPMCU log as-is. BUG=b:264674276 TEST=test/run_device_tests.py -b bloonchipper -t abort BRANCH=none Change-Id: I7b8bbc5da650a48b8e206dc72dd9756659af0f3c Signed-off-by: Andrea Grandi <agrandi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4149567 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_device_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/run_device_tests.py b/test/run_device_tests.py
index 7d61c35c5d..a2277afd4f 100755
--- a/test/run_device_tests.py
+++ b/test/run_device_tests.py
@@ -643,16 +643,18 @@ def run_test(
return False
continue
- logging.debug(line.decode("utf-8").rstrip())
test.logs.append(line)
# Look for test_print_result() output (success or failure)
line_str = process_console_output_line(line, test)
if line_str is None:
# Sometimes we get non-unicode from the console (e.g., when the
# board reboots.) Not much we can do in this case, so we'll just
- # ignore it.
+ # ignore it and print log the line as is.
+ logging.debug(line)
continue
+ logging.debug(line_str.rstrip())
+
for finish_re in test.finish_regexes:
if finish_re.match(line_str):
# flush read the remaining