Skip to content

Template/MVC tests fail after updating TFM to net7.0 #36765

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

Closed
wtgodbe opened this issue Sep 20, 2021 · 2 comments · Fixed by #38190
Closed

Template/MVC tests fail after updating TFM to net7.0 #36765

wtgodbe opened this issue Sep 20, 2021 · 2 comments · Fixed by #38190
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates bug This issue describes a behavior which is not expected - a bug. feature-templates test-failure

Comments

@wtgodbe
Copy link
Member

wtgodbe commented Sep 20, 2021

Templates.Test.BaselineTest.Template_Produces_The_Right_Set_Of_FilesAsync(arguments: "new react", expectedFiles: ["ClientApp/public/favicon.ico", "ClientApp/public/index.html", "ClientApp/public/manifest.json", "ClientApp/src/components/Counter.js", "ClientApp/src/components/FetchData.js", ...])

Expected file to exist, but it doesn't: ClientApp/src/reportWebVitals.js

Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationTest.CacheTagHelper_BubblesExpirationOfNestedTagHelpers

Assert.Equal() Failure
↓ (pos 33)
Expected: ···ctronics
Products: Music Systems, Televisions (3)
Actual: ···ctronics
Products: Book1, Book2 (1)
↑ (pos 33)

Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelperTest.ProcessAsync_FlowsEntryLinkThatAllowsAddingTriggersToAddedEntry

Assert.False() Failure
Expected: False
Actual: True
at Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelperTest.ProcessAsync_FlowsEntryLinkThatAllowsAddingTriggersToAddedEntry() in /_/src/Mvc/Mvc.TagHelpers/test/CacheTagHelperTest.cs:line 539

@wtgodbe wtgodbe added test-failure area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-templates labels Sep 20, 2021
@mkArtakMSFT mkArtakMSFT added this to the .NET 7 Planning milestone Sep 21, 2021
@BrennanConroy
Copy link
Member

BrennanConroy commented Oct 30, 2021

This is caused by dotnet/runtime#57648 which made a breaking change to the MemoryCache on purpose.

I'm not sure if the product needs to change or just the two tests affected.

CacheTagHelper_BubblesExpirationOfNestedTagHelpers can be fixed by adding
services.AddMemoryCache(o => o.TrackLinkedCacheEntries = true); to the Startup of HtmlGenerationWebSite
and TrackLinkedCacheEntries = true to CacheTagHelperMemoryCacheFactory.

ProcessAsync_FlowsEntryLinkThatAllowsAddingTriggersToAddedEntry can be fixed by setting TrackLinkedCacheEntries to true when newing up the MemoryCacheOptions.

@Tratcher
Copy link
Member

Tratcher commented Nov 8, 2021

Offline notes: This is a product regression for cache tag helpers and we should turn TrackLinkedCacheEntries back on in MVC for this scenario.

@Tratcher Tratcher added the bug This issue describes a behavior which is not expected - a bug. label Nov 8, 2021
@Tratcher Tratcher self-assigned this Nov 8, 2021
Tratcher added a commit to Tratcher/aspnetcore that referenced this issue Nov 9, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates bug This issue describes a behavior which is not expected - a bug. feature-templates test-failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants