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

Add exponential backoff into test retrying mechanics #779

Open
maksym-zhokha opened this issue Oct 25, 2023 · 1 comment
Open

Add exponential backoff into test retrying mechanics #779

maksym-zhokha opened this issue Oct 25, 2023 · 1 comment

Comments

@maksym-zhokha
Copy link

maksym-zhokha commented Oct 25, 2023

What do you think about adding exponential backoff to existing RetryingTest functionality?

For example:
There is already suspendForMs which allows to put some constant time so that JUnit will wait this portion of time before running test again. By adding some exponential backoff (with base 2) JUnit will wait between second and third (if second test try also was failed) tries 2 x suspendForMs. Waiting for the next try will took 4 x suspendForMs.

@maksym-zhokha maksym-zhokha changed the title Add exponential backoff into test retrying machanics Add exponential backoff into test retrying mechanics Oct 25, 2023
@IlyasYOY
Copy link
Contributor

IlyasYOY commented Oct 29, 2023

This issue is heavily entangled with this one: #783

If both might be implemented I'd recommend to add some kind of IoC for suspension time.

We could add suspensionTimeProvider parameter, which takes class implementing SuspensionTimeProvider. The extension instantiates an object of this class using default no args constructor (or using SPI) and retrieves time interval by iteration number.

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

No branches or pull requests

3 participants