mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/ttfw_fix_flush_index_error' into 'master'
test: TTFW fix flush index error See merge request espressif/esp-idf!14217
This commit is contained in:
commit
35f8caf1cb
@ -548,13 +548,11 @@ class BaseDUT(object):
|
|||||||
:return: match groups if match succeed otherwise None
|
:return: match groups if match succeed otherwise None
|
||||||
"""
|
"""
|
||||||
ret = None
|
ret = None
|
||||||
if isinstance(pattern.pattern, type(u'')):
|
if isinstance(pattern.pattern, bytes):
|
||||||
pattern = re.compile(BaseDUT.u_to_bytearray(pattern.pattern))
|
pattern = re.compile(_decode_data(pattern.pattern))
|
||||||
if isinstance(data, type(u'')):
|
|
||||||
data = BaseDUT.u_to_bytearray(data)
|
|
||||||
match = pattern.search(data)
|
match = pattern.search(data)
|
||||||
if match:
|
if match:
|
||||||
ret = tuple(None if x is None else x.decode() for x in match.groups())
|
ret = tuple(x for x in match.groups())
|
||||||
index = match.end()
|
index = match.end()
|
||||||
else:
|
else:
|
||||||
index = -1
|
index = -1
|
||||||
@ -604,6 +602,7 @@ class BaseDUT(object):
|
|||||||
while True:
|
while True:
|
||||||
ret, index = method(data, pattern)
|
ret, index = method(data, pattern)
|
||||||
if ret is not None:
|
if ret is not None:
|
||||||
|
stdout = data[:index]
|
||||||
self.data_cache.flush(index)
|
self.data_cache.flush(index)
|
||||||
break
|
break
|
||||||
time_remaining = start_time + timeout - time.time()
|
time_remaining = start_time + timeout - time.time()
|
||||||
@ -611,7 +610,6 @@ class BaseDUT(object):
|
|||||||
break
|
break
|
||||||
# wait for new data from cache
|
# wait for new data from cache
|
||||||
data = self.data_cache.get_data(time_remaining)
|
data = self.data_cache.get_data(time_remaining)
|
||||||
stdout = data
|
|
||||||
|
|
||||||
if ret is None:
|
if ret is None:
|
||||||
pattern = _pattern_to_string(pattern)
|
pattern = _pattern_to_string(pattern)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user