dotnet / systemweb-adapters

MIT License
337 stars 59 forks source link

Use hosted environment for CacheDependency tests #464

Closed twsouthwick closed 9 months ago

twsouthwick commented 9 months ago

This moves tests that require CacheDependency into CoreServices. The implementation of this requires HttpRuntime.Cache to be set in some code paths and so we need to use the SelfHostedTests collection to ensure this is setup correctly and doesn't stomp on other tests. The change looks bigger than it is because of code movement - the only real change is the change to DependentItemCallback to use an actual host (test was originally written before this pattern was used in the codebase).

twsouthwick commented 9 months ago

@joperezr looks like the build servers might have changed as I saw a test failure on my recent change. It was a race condition in the structure of the test itself so not a regression or anything, but this fixes that.