Deflake implementation moved try-except-finally check inside the loop - so if an exception happens when reporting another exception (inside except BaseException), inner finally block inside the loop will execute, but everything outside the loop won't - meaning runner_client will never report the results back.
This is a rare case, and it's unlikely to come up in real world, but it is possible.
Fixed by extracting a single test execution into a separate function, and wrapping a deflake loop in a try-finally. No need for except, we'll let the inner exception from the _do_run to bump through.
Also updated the unit test to how it was before deflake.
Deflake implementation moved try-except-finally check inside the loop - so if an exception happens when reporting another exception (inside
except BaseException
), innerfinally
block inside the loop will execute, but everything outside the loop won't - meaning runner_client will never report the results back. This is a rare case, and it's unlikely to come up in real world, but it is possible. Fixed by extracting a single test execution into a separate function, and wrapping a deflake loop in a try-finally. No need for except, we'll let the inner exception from the _do_run to bump through. Also updated the unit test to how it was before deflake.