Replies: 3 comments 6 replies
-
I don't object to this, but I would be interested to understand why it might be better than using a library like Polly. Have you tried using a transient-fault handling library to achieve retries (or any other transient-fault handling pattern?) |
Beta Was this translation helpful? Give feedback.
-
I also don't object (the idea with Polly by @Code-Grump is pretty interesting though). I have some generic comments / thoughts based on this.
|
Beta Was this translation helpful? Give feedback.
-
I'd go one step further and use names policies akin to how authorization policies work in asp.net where you define named policies and then later in the attribute specify which policy is to be used. |
Beta Was this translation helpful? Give feedback.
-
I was wondering if you see value in a plugin that automatically initiates retries on failed steps instead of complete scenarios? I have a small Proof Of Concept that might be useful for decoupling the logic of a step definition from its need to be retried.
Why retry steps?
My System Under Test (SUT) runs asynchronously and needs time to reach the correct state. During this time the various
Then
steps may not fail the scenario. While the scenario is executing, it may even contain steps to change the grace period.How the plugin is implemented
The plugin registers a custom
ITestExecutionEngine
. This custom engine derives from the default ReqnrollTestExecutionEngine
but overrides theExecuteStepMatchAsync
method to:IRetryStepPluginConfiguration
from the ScenarioContainer and ask if the currentBindingMatch
should be retried.IAsyncRetryer
from the ScenarioContainer to perform the retry logic on the invocation of the binding like thisHow the author provides the logic and decisions needed to retry
The author of the step definition registers a
IRetryStepPluginConfiguration
in the scenario container. This object has 1 method to decide if aBindingMatch
should be retried or not.They also register a
IAsyncRetryer
having theTask RetryAsync(Func<Task> action)
method. This object is responsible for doing the retry logic. For example:Beta Was this translation helpful? Give feedback.
All reactions