From 5ad71d09015c4a5377480557f8dbd5d670841146 Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Thu, 9 May 2024 09:03:03 +0300 Subject: [PATCH] some changes --- unit-tests/py/rspy/test.py | 3 +++ unit-tests/run-unit-tests.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/unit-tests/py/rspy/test.py b/unit-tests/py/rspy/test.py index d8c64258696..4bc6929b336 100644 --- a/unit-tests/py/rspy/test.py +++ b/unit-tests/py/rspy/test.py @@ -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(): """ diff --git a/unit-tests/run-unit-tests.py b/unit-tests/run-unit-tests.py index a65482a5f95..e53a8af06a4 100644 --- a/unit-tests/run-unit-tests.py +++ b/unit-tests/run-unit-tests.py @@ -433,7 +433,7 @@ 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 @@ -441,13 +441,13 @@ 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