mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-30 04:34:40 +02:00
bug/wiremock-1268 moving Scenario state change before global response delay (#1436)
Co-authored-by: Stef Heyenrath <Stef.Heyenrath@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a453e00fdb
commit
479bb0b8ec
@@ -122,6 +122,14 @@ internal class WireMockMiddleware(
|
||||
}
|
||||
}
|
||||
|
||||
// Transition scenario state immediately after matching, before any delay (global or
|
||||
// per-mapping) so that concurrent retries arriving during a delay period see the
|
||||
// updated state and match the correct next mapping instead of re-matching this one.
|
||||
if (targetMapping.Scenario != null)
|
||||
{
|
||||
UpdateScenarioState(targetMapping);
|
||||
}
|
||||
|
||||
if (!targetMapping.IsAdminInterface && options.RequestProcessingDelay > TimeSpan.Zero)
|
||||
{
|
||||
await Task.Delay(options.RequestProcessingDelay.Value).ConfigureAwait(false);
|
||||
@@ -147,11 +155,6 @@ internal class WireMockMiddleware(
|
||||
}
|
||||
}
|
||||
|
||||
if (targetMapping.Scenario != null)
|
||||
{
|
||||
UpdateScenarioState(targetMapping);
|
||||
}
|
||||
|
||||
if (!targetMapping.IsAdminInterface && targetMapping.Webhooks?.Length > 0)
|
||||
{
|
||||
await SendToWebhooksAsync(targetMapping, request, response).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user