Skip to content

Scenario state change before a response delay timeout ends #1260

@vsoldatkin

Description

@vsoldatkin

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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions