Closed ggnaegi closed 1 year ago
@raman-m @RaynaldM This PR is ready for review.
I have added several unit tests:
AsyncCircuitBreakerPolicy<HttpResponseMessage>
and AsyncTimeoutPolicy<HttpResponseMessage>
if ExceptionsAllowedBeforeBreaking > 0BrokenCircuitException<HttpResponseMessage>
on third faulty attempt if ExceptionsAllowedBeforeBreaking = 2Hopefully I have a solution for the possibly broken service, I have simplified the logic here: https://github.com/ThreeMammals/Ocelot/issues/1706
private void GivenThereIsAPossiblyBrokenServiceRunningOn(string url, string responseBody)
{
var requestCount = 0;
_serviceHandler.GivenThereIsAServiceRunningOn(url, async context =>
{
if (requestCount == 1)
{
await Task.Delay(1000);
}
requestCount++;
context.Response.StatusCode = 200;
await context.Response.WriteAsync(responseBody);
});
}
Gui, would you like to include this fix in October release?
Gui, would you like to include this fix in October release?
I think so yes.
Gui, As you see, I've rebased feature branch... And I'll review tomorrow... Happy presentation tomorrow! 😉
@raman-m are you sure that it's not a bit over-engineered? (FileConfiguration)
@ggnaegi commented on Nov 3 a bit over-engineered?
Why not if I have some time for this... I agree that refactoring of tests doesn't provide much benefit. 🆗 I won't you bother on tests... Let's focus on real code...
@ggnaegi Let me know you're 🆗 to merge plz? I'm going to add a couple of tiny fixes... So, it seems, this PR will be merged first than #1745 ... And you will need to apply new logger string-factories for all new logging operators being added by this PR.
Regarding the Open_circuit_should_not_effect_different_route() test... Here are my testing results of 1000 runs for the test;
It is definitely stable now. But I don't know how to get CircleCI environment tests... Seems we have to watch for this test on CircleCI in the latest builds after merging PR...
Anyway, I would say, It should be stable now, and #1706 will not be reproducible after merging this PR. So, we could attach #1706 to this PR. Could we, Gui?
Great!
Fixes #1550 #1706
1550
1706
Proposed Changes