Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibCI - Recycle device on retry #12911

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion unit-tests/py/rspy/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ def finish( on_fail=LOG ):
log.i("Test passed")
test_in_progress = None


def print_separator():
"""
For use only in-between test-cases, this will separate them in some visual way so as
Expand Down
13 changes: 11 additions & 2 deletions unit-tests/run-unit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def configuration_str( configuration, repetition=0, retry=0, sns=None, prefix=''
elif sns is not None:
s += '[' + serial_numbers_to_string( sns ) + ']'
if repetition:
s += '[' + str(repetition+1) + ']'
s += f'[rep {repetition+1}]'
if retry:
s += f'[retry {retry}]'
if s:
Expand Down Expand Up @@ -441,10 +441,19 @@ def test_wrapper( test, configuration=None, repetition=1, sns=None ):
global n_tests
n_tests += 1
for retry in range( test.config.retries + 1 ):
if retry:
if log.is_debug_on():
log.debug_unindent() # just to make it stand out a little more
log.d( f' Failed; retry #{retry}' )
log.debug_indent()
if no_reset:
time.sleep(1) # small pause between tries
else:
devices.enable_only( serial_numbers, recycle=True )
if test_wrapper_( test, configuration, repetition, retry, sns ):
return True
log._n_errors -= 1
time.sleep( 1 ) # small pause between tries

log._n_errors += 1
return False

Expand Down
Loading