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

Number of retries must be a constant and hardcoded #54

Open
foxfortune opened this issue Jan 22, 2020 · 2 comments
Open

Number of retries must be a constant and hardcoded #54

foxfortune opened this issue Jan 22, 2020 · 2 comments

Comments

@foxfortune
Copy link

Currently the number of retries that you want a test to do is passed in through the annotation, this means it must be a constant.

There are cases where different jobs may want to have a different number of retries, for example branch builds may want to retry more because they care more about getting a consistent result.

@foxfortune
Copy link
Author

foxfortune commented Jan 22, 2020

I made this change locally would push a branch but permissions are locked:

public static int getTotalNumberOfRepeats(){
        String totalRepeats = System.getenv("totalRepeats");

        if(totalRepeats != null) {
            try {
                return Integer.valueOf(totalRepeats);
            }catch(Exception e){
                return annotationParams.repeats();
            }
        }
        return annotationParams.repeats();
    }

Then call that method when setting totalRepeats:
int totalRepeats = getTotalNumberOfRepeats()

@MeikeMertsch
Copy link

The way I did it was forking and then doing a PR. Artem did react quite fast

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