From 724a8057812890761a04212b4451c3c1da1cf950 Mon Sep 17 00:00:00 2001 From: Eran Date: Mon, 13 May 2024 10:09:06 +0300 Subject: [PATCH] updates --- unit-tests/run-unit-tests.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/unit-tests/run-unit-tests.py b/unit-tests/run-unit-tests.py index 98a136789c..158e79ad9c 100644 --- a/unit-tests/run-unit-tests.py +++ b/unit-tests/run-unit-tests.py @@ -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: @@ -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=' ' ) ) @@ -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