Skip to content

Commit

Permalink
PR #12911 from Nir: [LibCI] recycle device on retries
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored May 13, 2024
2 parents cf3252f + 724a805 commit 53b5d60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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 @@ -274,7 +274,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 @@ -454,10 +454,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

0 comments on commit 53b5d60

Please sign in to comment.