Closed lxs65 closed 8 months ago
Can you share an example repro? The stacktrace alone is not giving enough info to pinpoint anything specific.
Between 1.2 and 1.3, the lifetime of a couple of things that were per-request were moved to be per-host to better mimic ASP.NET Framework behavior. For example, HttpRuntime
and HostingEnvironment
APIs, so maybe something there is causing this?
For reference, this is how we recommend testing it with the TestServer tools: https://learn.microsoft.com/en-us/aspnet/core/migration/inc/unit-testing. I have not tried it with the WebApplicationFactory pattern.
Hi Taylor,
In relation to the above referred issue earlier reported by me: we managed to reproduce the issue in an isolated fashion. What is the best way to forward it to you?
BTW Is there any interest from your (i.e., Microsoft) side to restart the monthly Wednesday discussion with you and John? It stopped last year well before the Season Holidays and was never started up again afterwards. Rens Segaar Senior Software Engineer @. Molengraaffsingel 33, 2629 JD Delft The Netherlands T +31 (0)15 - 711 51 00 @*.**@*.***> www.exact.comhttps://exact.com/
Follow us LinkedInhttps://www.linkedin.com/company/exact | Twitterhttps://twitter.com/exact_NL | Facebookhttps://www.facebook.com/ExactWorld/ | Youtubehttps://www.youtube.com/user/Exacttv | Instagramhttps://www.instagram.com/exact/ @.*** DISCLAIMER The information in this e-mail message is privileged and confidential and is only intended for the addressee. If you received this e-mail in error, you are hereby notified that any disclosure, reproduction, distribution or use of this message and any attachments is strictly prohibited. Please notify the sender immediately and delete the e-mail without copying or disclosing its contents to any other person. No legal consequences can be derived from the contents of this e-mail. Neither the sender nor Exact Holding B.V. (or any of its related companies) accept liability for any damage resulting from the use and/or acceptance of the content of this e-mail message.
Please consider the environment before printing this message.
From: Taylor Southwick @.> Sent: Tuesday, January 9, 2024 03:32 To: dotnet/systemweb-adapters @.> Cc: Rens Segaar @.>; Author @.> Subject: Re: [dotnet/systemweb-adapters] API integration tests broken by 1.3.0 (Issue #462)
CAUTION: This e-mail is sent from an external email address. Please do not open attachments or click links from an unknown or suspicious origin. If you have any questions or concerns, please contact the IT Services team
Can you share an example repro? The stacktrace alone is not giving enough info to pinpoint anything specific.
Between 1.2 and 1.3, the lifetime of a couple of things that were per-request were moved to be per-host to better mimic ASP.NET Framework behavior. For example, HttpRuntime and HostingEnvironment APIs, so maybe something there is causing this?
For reference, this is how we recommend testing it with the TestServer tools: https://learn.microsoft.com/en-us/aspnet/core/migration/inc/unit-testing. I have not tried it with the WebApplicationFactory pattern.
- Reply to this email directly, view it on GitHubhttps://github.com/dotnet/systemweb-adapters/issues/462#issuecomment-1882224766, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BB2FIZE6AHC2UNMQWBEKWHLYNST3FAVCNFSM6AAAAABBFQ7DMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGIZDINZWGY. You are receiving this because you authored the thread.Message ID: @.**@.>>
Closing out the issue as we discussed offline and found the issue to be that WithWebHostBuilder creates a new host which will try to set the HttpRuntime. Ensuring that this and the original host is disposed fixed the issue.
It looks like systemweb adapters 1.3.0 breaks all our integration tests, testing Controller-based API's, using XUnit (latest version) with its
IClassFixture
and applingWebApplicationFactory
and still using .NET 6. With systemweb adapters 1.2.0 all tests were green, with 1.3.0 at most one test is green, the rest fails. Running each test separately has the test always succeed.The tests consistently fail with the following error:
This seems to suggest somehow the
TestServer
instance is being disposed at an unfortunate moment.This even happens for a test as simple as (and seemingly totally isolated from the other tests)...
...when this is made part of the set of API tests.
All our main API tests follow the main construction for accessing a client as follows:
whereby the error obviously pops up at the
CreateClient()
call.