Scenario state change before a response delay timeout ends #673

Open
opened 2025-12-29 15:30:32 +01:00 by adam · 0 comments
Owner

Originally created by @vsoldatkin on GitHub (Mar 8, 2025).

Originally assigned to: @StefH on GitHub.

I want to use WireMock.Net for mocking two consecutive identical requests:

  1. First one responds after a certain timeout (using a Delay feature)
  2. Second one responds immediately

My client code under test is making a request with a timeout and then retries immediately with identical payload.

I configure the mappings like this:
Mapping 1: scenario A, transition to State1
Mapping 2: scenario A, when state is State1

This is not working as I expect since my client code makes the second request before the delay on the first mapping ends.

According to the code db158bcc7e/src/WireMock.Net/Owin/WireMockMiddleware.cs (L176) wiremock waits for delays first and makes a state transition as one of the finishing steps.

Shouldn't we rather expect a state transition to occur as early as an appropriate match was found?

Originally created by @vsoldatkin on GitHub (Mar 8, 2025). Originally assigned to: @StefH on GitHub. I want to use WireMock.Net for mocking two consecutive identical requests: 1. First one responds after a certain timeout (using a Delay feature) 2. Second one responds immediately My client code under test is making a request with a timeout and then retries immediately with identical payload. I configure the mappings like this: Mapping 1: scenario A, transition to State1 Mapping 2: scenario A, when state is State1 This is not working as I expect since my client code makes the second request before the delay on the first mapping ends. According to the code https://github.com/WireMock-Net/WireMock.Net/blob/db158bcc7eb8195c5ae13665c67286865827275b/src/WireMock.Net/Owin/WireMockMiddleware.cs#L176 wiremock waits for delays first and makes a state transition as one of the finishing steps. Shouldn't we rather expect a state transition to occur as early as an appropriate match was found?
adam added the bug label 2025-12-29 15:30:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#673