gradle / test-retry-gradle-plugin

Gradle plugin to retry tests that have failed to mitigate test flakiness.
Apache License 2.0
222 stars 50 forks source link

Handle class setup failures preventing previously failed methods from retrying #177

Closed pshevche closed 1 year ago

pshevche commented 1 year ago

Summary

If class setup fails, then test methods that failed in the previous execution won't be retried. In this case, we used to throw an error since we did not retry things that should be retried. This PR solves the issue by clearing the list of to-be-retried methods if class-level failure occurs. In this case, the entire class will be retried anyways, so it is safe to just clear that list. If previous run had other lifecycle errors, we track those to ensure we report successful execution of those.