mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/ttfw_example_test_fails_port_remains_open_v3.3' into 'release/v3.3'
ci: Fix CI issue if one example test fails, and if serial port returns some noise (v3.3) See merge request espressif/esp-idf!12384
This commit is contained in:
commit
0b1bc0b5b8
@ -40,6 +40,7 @@ If they using different port then need to implement their DUTPort class as well.
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import copy
|
import copy
|
||||||
import functools
|
import functools
|
||||||
@ -78,11 +79,15 @@ def _expect_lock(func):
|
|||||||
def _decode_data(data):
|
def _decode_data(data):
|
||||||
""" for python3, if the data is bytes, then decode it to string """
|
""" for python3, if the data is bytes, then decode it to string """
|
||||||
if isinstance(data, bytes):
|
if isinstance(data, bytes):
|
||||||
# convert bytes to string
|
# convert bytes to string. This is a bit of a hack, we know that we want to log this
|
||||||
|
# later so encode to the stdout encoding with backslash escapes for anything non-encodable
|
||||||
|
out_enc = sys.stdout.encoding
|
||||||
|
if out_enc is None:
|
||||||
|
out_enc = 'ascii'
|
||||||
try:
|
try:
|
||||||
data = data.decode("utf-8", "ignore")
|
return data.decode(out_enc, "backslashreplace")
|
||||||
except UnicodeDecodeError:
|
except (UnicodeDecodeError, TypeError): # Python <3.5 doesn't support backslashreplace
|
||||||
data = data.decode("iso8859-1", )
|
return data.decode(out_enc, "replace")
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import threading
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
import netifaces
|
import netifaces
|
||||||
|
import traceback
|
||||||
|
|
||||||
import EnvConfig
|
import EnvConfig
|
||||||
|
|
||||||
@ -180,6 +181,7 @@ class Env(object):
|
|||||||
try:
|
try:
|
||||||
dut.close()
|
dut.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
traceback.print_exc()
|
||||||
dut_close_errors.append(e)
|
dut_close_errors.append(e)
|
||||||
self.allocated_duts = dict()
|
self.allocated_duts = dict()
|
||||||
return dut_close_errors
|
return dut_close_errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user