You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whilst testing timeout and retry policies I came across an issue where LogEntries were not updated before the test finished. Take this example, not exact code:
// handle 5**, 408,// retry 3 times with a timeout per retryvarretryPolicy= HttpPolicyExtensions
.HandleTransientHttpError().Or<TimeoutRejectedException>().RetryAsync(3);varpolicy= retryPolicy.WrapAsync(
HttpPolicy.TimeoutAsync(TimeSpan.FromMilliseconds(300)));usingvarserver= WireMockServer.Start();
server
.Given(Request.Create().UsingGet()).RespondWith(Response.Create().WithDelay(1000).WithStatusCode(HttpStatusCode.InternalServerError));varhttpClient= CreateHttpClient(policy);await Assert.ThrowsAsync<TimeoutRejectedException>(()=> httpClient.GetAsync(server.Url));// wiremock leaves recording the requests till the end which means timeouts cause LogEntries to go missing.
_testOutputHelper.WriteLine("Calls made: "+ wireMockServer.LogEntries.Count());
The WithDelay(1000) will cause the policy to timeout (within 300ms), eventually throwing a TimeoutRejectedException, the test will end with a printed line of Calls made: 1 as the other calls are still processing.
Can we add the LogEntry as soon as the request has been received, update when match has been made, with null values for the response, then update it when a response has been created?
The text was updated successfully, but these errors were encountered:
Whilst testing timeout and retry policies I came across an issue where LogEntries were not updated before the test finished. Take this example, not exact code:
The
WithDelay(1000)
will cause the policy to timeout (within 300ms), eventually throwing a TimeoutRejectedException, the test will end with a printed line ofCalls made: 1
as the other calls are still processing.Can we add the
LogEntry
as soon as the request has been received, update when match has been made, with null values for the response, then update it when a response has been created?The text was updated successfully, but these errors were encountered: