-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mock server not answer if integrated in Xamarin UITest project #534
Comments
@DellaMoraWalter for some reason WireMock.Net does not work when you set breakpoints. See #510 I also would love to get to the bottom of this. |
@xadvfh in my attached sample solution the breakpoint works correctly if the wikemock server is started with the console application but don't works if the wiremock server is started inside the UITest project. |
I guess it could also be related to UI threads and background threads in a Xamarin project. |
@DellaMoraWalter I am pretty sure I came across this same problem today (and solved it) as I found this issue while doing some research. I was able to reproduce this in Visual Studio 16.8.3 (for reference only, I don't believe this actually matters). In our case, we're setting up WireMock to emulate a remote API. The behavior was very similar; we could make the request using our Ultimately, I was able to view an unhandled exception in the WireMock internals during the teardown.
Inspecting the Fusion logs, I found that there were two assemblies that were not correctly loading.
Adding just the redirect for the
Adding assembly binding redirects for both of these assemblies to the <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="4.0.2.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="4.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime> I have pushed a very simple repro/fix to a branch kcamp@36f446b; I did not attempt to run your tests @DellaMoraWalter, but, looking at your attached In that branch, kcamp@36f446b, the steps to repro are basically this:
(The endpoint being invoked is immaterial, I was able to observe the same issues as a matter of the hosting, not so much individual implementations) This seems to be vaguely familiar to the behavior described in #393 as well
@StefH This does seem like some sort of issue with the way this is behaving in .NET 4.6.1; not to say it's not purely environmental in our cases. If there is any additional detail I can provide to help diagnose or do a deeper dive to understand the why, please let me know, I'd be happy to provide any details I might be able to. |
Hello @kcamp, thank you for the research. @DellaMoraWalter can you try if this workaround solves your issue? If this indeed solves the issue, I'll add this to a wiki page. (Note that issue also looks a bit like this one #437) |
Can you try preview: Info : https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions |
I've added I'm closing this issue now, a new official version will be released in some days. |
I'm encountering a problem using WireMock.Net in a Xamarin UITest project, currently with Android (iOS not tested yet).
I'm trying to mock my backend, the WireMock instance is created in the UITest project but even if the server is active, the calls are not processed.
I've attached a full example for reproduce the problem, for use remember to align the ip address of the wiremock server with your machine ip address.
If you start the only test defined in MockBackendTests, this fail after the timeout because the call to the wiremock server never gets an answer.
In the solution you can find the 'MockBackendConsole' application that can create an identical instance of wiremock server.
To try it you have to:
I've integrated the solution with the last (v 1.3.5) wiremock.net source code, and set a breackpoint in WireMockMiddleware.cs.
If the mock server is create inside the UITest project, the 'InternalInvoke' function is never called.
Unfortunately I don't understand the problem behind this behavior.
Thanks for support.
MockBackend.zip
The text was updated successfully, but these errors were encountered: