Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run command before retry or before last retry #206

Open
Tracked by #271
oeresundsgruppen opened this issue Aug 10, 2023 · 2 comments
Open
Tracked by #271

Run command before retry or before last retry #206

oeresundsgruppen opened this issue Aug 10, 2023 · 2 comments

Comments

@oeresundsgruppen
Copy link

Would it be an idea to allow to run a command before a retry or before last retry, e.g. restart a service, reload db etc.

CommandBeforeRetry=sqlcmd delete from tableX
CommandBeforeLastRetry=gradlew restartX && wait 60

Maybe I could add this and make PR for your review ?

@oeresundsgruppen
Copy link
Author

This is beneficial when tests are not mackovian, e.g. they built up state...

@pshevche
Copy link
Member

pshevche commented Apr 2, 2024

@oeresundsgruppen , thank you for reporting this proposal and volunteering to work on this. Could you help us understand the scenario better?

It seems like the class' lifecycle methods like JUnit's @BeforeEach or @BeforeAll would be a good place for such commands. Those will be executed before each retry, and you could then restart a service, etc.

Can you maybe give an example where this will not work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants