Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 9, 2024
1 parent 7c750ce commit 5ad71d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions unit-tests/py/rspy/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ def finish( on_fail=LOG ):
log.i("Test passed")
test_in_progress = None

def passed():
return not test_failed


def print_separator():
"""
Expand Down
6 changes: 3 additions & 3 deletions unit-tests/run-unit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,21 +433,21 @@ def test_wrapper_( test, configuration=None, repetition=1, retry=0, sns=None ):
configuration_str( configuration, repetition, suffix=' ' ) + 'exited with non-zero value (' + str(
cpe.returncode ) + ')' )
else:
return True
return test.passed()
return False


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 test_wrapper_( test, configuration, repetition, retry, sns ) and log.n_errors() == 0:
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.d("retry", retry + 1, "out of", test.config.retries)
log.w("retry", retry + 1, "out of", test.config.retries)
devices.enable_only(serial_numbers, recycle=True)

log._n_errors += 1
Expand Down

0 comments on commit 5ad71d0

Please sign in to comment.