-
Notifications
You must be signed in to change notification settings - Fork 148
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
Excessive retries in test workflow environment #626
Comments
Linking #499 as a different, but very relevant request. We should discuss the behavior of retries with our testing framework / time skipping / debugging mode. |
@tsurdilo what is the definition of "excessive" retries? And how the framework should define which is excessive in each specific scenario? From my point of view, the described situation is not a problem and is actually expected behavior. A workflow activity should be retried the same amount of times in tests with time-skipping as it actually would be executed in 5 days before failing the workflow. And a lot of users will not be happy if it's not like that, it will be quite misleading and error-prone. There is a way to achieve what you want though: |
i think in a test its different as you dont in most cases fix the error on activity after a number of retries. maybe if use knows they are testing activity failure specifically then the number of retries can even be 0 . or some number in config as activity options can be specified in workflow tested so they cannot be changed in test |
@mfateev wdyt? |
We shouldn't completely cut off activity retries in tests because a lot of users would want to test and verify the retries' count, behavior, or even potential side effects. |
Yes, I think that would be nice if possible: I think this could help also with some scenarios where for example you have ActivityOptions that specify a different task queue and you have to create extra workers for it in your tests, so ability to default all task queues for tested workflow and all its activities to the one created automatically by TestWorkflowRule, but that might be asking too much, idk :) |
When testing an activity that constantly fails (cannot recover from the failure) and has a large scheduleToClose timeout set (like days/months), or does not have one set at all
the testing framework will keep retrying in some cases thousands of times.
Asking to add a feature that in those edge cases to not retry, but skip time so the excessive retries are avoided in tests.
To reproduce you can have a workflow which calls a single activity with activity options setScheduleToCloseTimeout set to 5 days for example. Set the activity to fail with for example:
throw Activity.wrap(new Exception("oops"));
in test you will see that it performs over 4K retries before timing out.
The text was updated successfully, but these errors were encountered: