Timeouts with WireMock.Net server started in Specflow #421

Closed
opened 2025-12-29 15:23:30 +01:00 by adam · 3 comments
Owner

Originally created by @gourdua on GitHub (Jun 1, 2022).

Hi

We use Specflow 3 with mstest in a .NET Framework 4.7.2 project for our CI tests. Im' trying to user Wiremock.net version 1.4.43 to mock restApi Calls. So far, only Wiremock started in a separate console application is working. If i copy the same startup code directly in my stepdefinition or specflowhook, result in a timeout...

_wmserver = WireMockServer.Start(new WireMock.Settings.WireMockServerSettings
{
	ReadStaticMappings = true,
	AllowPartialMapping = true,
	HandleRequestsSynchronously = true,
	UseSSL = false,
});

_wmserver.Url is then injected in my configuration, and the specflow is executed... i get the following error:

System.Web.HttpException: 0 : The operation has timed out

I've seen some post discussing about this but no solution provided fixed mine. adding HandleRequestsSynchronously = was one of them.

Any advice?

Thanks

Originally created by @gourdua on GitHub (Jun 1, 2022). Hi We use Specflow 3 with mstest in a .NET Framework 4.7.2 project for our CI tests. Im' trying to user Wiremock.net version 1.4.43 to mock restApi Calls. So far, only Wiremock started in a separate console application is working. If i copy the same startup code directly in my stepdefinition or specflowhook, result in a timeout... _wmserver = WireMockServer.Start(new WireMock.Settings.WireMockServerSettings { ReadStaticMappings = true, AllowPartialMapping = true, HandleRequestsSynchronously = true, UseSSL = false, }); _wmserver.Url is then injected in my configuration, and the specflow is executed... i get the following error: System.Web.HttpException: 0 : The operation has timed out I've seen some post discussing about this but no solution provided fixed mine. adding HandleRequestsSynchronously = was one of them. Any advice? Thanks
adam added the doc label 2025-12-29 15:23:30 +01:00
adam closed this issue 2025-12-29 15:23:30 +01:00
Author
Owner

@StefH commented on GitHub (Jun 1, 2022):

Can you please provide a full working example which demonstrates your issue?

@StefH commented on GitHub (Jun 1, 2022): Can you please provide a full working example which demonstrates your issue?
Author
Owner

@gourdua commented on GitHub (Jun 2, 2022):

Hi,
Trying to create a working example starting a new specflow project in Visual studio 2019 kinda clean specflow, i cannot reproduce the problem.

We are working with legacy specflow project file on my team(created years ago, maybe with VS 2012), and cannot pinpoint what exactly is causing this...

@gourdua commented on GitHub (Jun 2, 2022): Hi, Trying to create a working example starting a new specflow project in Visual studio 2019 kinda clean specflow, i cannot reproduce the problem. We are working with legacy specflow project file on my team(created years ago, maybe with VS 2012), and cannot pinpoint what exactly is causing this...
Author
Owner

@gourdua commented on GitHub (Jun 2, 2022):

Hi again!

Just found out we were missing 4 bindings redirects.

But somehow, that was causing the hang instead of throwing exception. I found out debuging and activating full Exception Break Logging on CLR Exception.

"System.Numerics.Vectors"
"System.Buffers"
"System.Runtime.CompilerServices.Unsafe"
"System.Threading.Tasks.Extensions"

hope this is helpful to someone one day...

@gourdua commented on GitHub (Jun 2, 2022): Hi again! Just found out we were missing 4 bindings redirects. But somehow, that was causing the hang instead of throwing exception. I found out debuging and activating full Exception Break Logging on CLR Exception. "System.Numerics.Vectors" "System.Buffers" "System.Runtime.CompilerServices.Unsafe" "System.Threading.Tasks.Extensions" hope this is helpful to someone one day...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#421