Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed May 13, 2024
1 parent a482695 commit 724a805
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 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 @@ -421,8 +421,6 @@ def test_wrapper_( test, configuration=None, repetition=1, retry=0, sns=None ):
if rslog:
opts.add( '--rslog' )
try:
if repetition > 0:
log.d("repeat #", repetition + 1)
test.run_test( configuration = configuration, log_path = log_path, opts = opts )
except FileNotFoundError as e:
log.e( log.red + test.name + log.reset + ':', str( e ) + configuration_str( configuration, repetition, prefix=' ' ) )
Expand All @@ -443,14 +441,18 @@ 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
if no_reset:
time.sleep(1) # small pause between tries
elif retry < test.config.retries:
log.w("retry", retry + 1, "out of", test.config.retries)
devices.enable_only(serial_numbers, recycle=True)

log._n_errors += 1
return False
Expand Down

0 comments on commit 724a805

Please sign in to comment.