lhotari opened a new pull request #9823:
URL: https://github.com/apache/pulsar/pull/9823
### Motivation
Some of the Pulsar tests setup the test environment in BeforeClass method
and run a cleanup in a AfterClass method. These test classes cannot be reliably
retried since the test environment state might be invalid after a test failure.
This PR includes changes that detect failures and whether cleanup has been
called for the current state or not. If the test hasn't been cleaned up, the
cleanup & setup will be called before the next test method is run.
### Modifications
- adds TestRetrySupport with the logic for tracking setup & cleanup state
- make MockedPulsarServiceBaseTest and ReplicatorTestBase extend
TestRetrySupport
so that all tests that extend these classes are covered with the solution
that re-initializes the test state by calling cleanup & setup if a failure is
detected.
- the implementation has handling for test classes that handle test
environment setup & cleanup in BeforeMethod and AfterMethod methods. The state
tracking will detect this and won't call cleanup if the state has already been
cleaned up in a AfterMethod cleanup method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]