-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Option to retry from a previous step on failure of step #623
Comments
@a1shadows , makes sense. You can look at this and add a test scenario 1st to check if this feature fails and push it, let the CI build fail. Appreciate your great suggestions and support. |
@authorjapps Do you have any suggestions on approach? The approaches I can think of are:
Can you think of any other approaches? |
Apologies, I couldn't get the problem statement correctly. Can you please give an example to explain it? Thanks |
I'm talking about a scenario like this:
Now, let's say the auth has a TTL of 2 seconds and the API call step fails and goes into retry: Since the auth has already expired, the second step is now doomed to fail no matter what. So, if we want to retry the second step, ideally we should be able to retry from the 1st step so that a fresh auth is generated for each time the api call step is executed. |
Understood. Thanks for explaining it. Yes, in theory, this is possible, but in reality I think it would be very very rare. Are you really facing this problem in your current project i.e. in test envs ? |
@authorjapps Hey, yes, we faced this problem at my workplace. So, the use case is something like this: There are 2 APIs:
Both APIs use a short lived dynamically generated auth strategy. Now, what I need is the capability to do a polling loop on the second API call in my test scenario with some poll interval and a timeout (similar to how the awaitability libs for java testing work). For this, I need the capability to retry both the auth generation step and the API call step with every retry. |
Got you @a1shadows. Note: Anyway, have a thought once again and then, if you really need, Example:
I think for your requirements,
Because, you could have in some situations more steps in between the n'th step and "auth_step" and executing all other steps are not necessary.
|
@authorjapps The steps will be executed in the order specified |
yep, I think that would be much better and this will accommodate various different usecases too. 👍
Yep, order is important |
@authorjapps Hey, I'm trying to figure out how to implement this feature and there are quite a few things to consider and work out. What is the purpose of I am currently planning on making the changes in the There also need to be some validations to make sure that the user does not submit a future step in the Do you have any suggestions? |
@authorjapps I came up with a Draft of changes(PR linked to this issue) to The idea is to make it easier to mutate ScenaioExecutionState in complex retry scenarios such as cases where previously successful steps need to be rerun. Another alternative can be to consider the retried steps as new steps with "-retry-{retriedStepName}" appended to the step name. |
@authorjapps I've implemented a working approach for this in the linked PR. Can you take a look? |
Thanks @a1shadows, was slightly busy with my day job, As the CI is Green 🟢 , hoping all is well, but will have a look soon anyways. 👍 |
@authorjapps
In situations where we need to retry a step that is dependent on a previous step, for eg. an api call that uses the previous step to generate auth, when the step is retried on failure, it should retry from the previous step.
I can look into adding this as a feature
The text was updated successfully, but these errors were encountered: