Skip to content

Commit

Permalink
PR #12933 from Eran: fix PR #12911: sleep if test is not live
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored May 16, 2024
2 parents f3f5c03 + fa561ae commit 064a234
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions unit-tests/run-unit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def test_wrapper_( test, configuration=None, repetition=1, retry=0, sns=None ):
return False


def test_wrapper( test, configuration=None, repetition=1, sns=None ):
def test_wrapper( test, configuration=None, repetition=1, serial_numbers=None ):
global n_tests
n_tests += 1
for retry in range( test.config.retries + 1 ):
Expand All @@ -459,11 +459,11 @@ def test_wrapper( test, configuration=None, repetition=1, sns=None ):
log.debug_unindent() # just to make it stand out a little more
log.d( f' Failed; retry #{retry}' )
log.debug_indent()
if no_reset:
if no_reset or not serial_numbers:
time.sleep(1) # small pause between tries
else:
devices.enable_only( serial_numbers, recycle=True )
if test_wrapper_( test, configuration, repetition, retry, sns ):
if test_wrapper_( test, configuration, repetition, retry, serial_numbers ):
return True
log._n_errors -= 1

Expand Down Expand Up @@ -599,7 +599,7 @@ def test_wrapper( test, configuration=None, repetition=1, sns=None ):
except RuntimeError as e:
log.w( log.red + test.name + log.reset + ': ' + str( e ) )
else:
test_ok = test_wrapper( test, configuration, repetition, sns=serial_numbers ) and test_ok
test_ok = test_wrapper( test, configuration, repetition, serial_numbers ) and test_ok
finally:
log.debug_unindent()
if not test_ok:
Expand Down

0 comments on commit 064a234

Please sign in to comment.