dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.44k stars 10.02k forks source link

Test failure: CacheTagHelper_AllowsVaryingByUICulture and CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions #4907

Closed ryanbrandenburg closed 5 months ago

ryanbrandenburg commented 6 years ago

This test fails occasionally with the following error:

Assert.Equal() Failure
           ↓ (pos 1)
Expected: 10
Actual:   14
           ↑ (pos 1)
   at Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationWithCultureTest.CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions() in /_/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs:line 152
--- End of stack trace from previous location where exception was thrown ---

Other tests within that build may have failed with a similar message, but they are not listed here. Check the link above for more info.

This test failed on 2.2.

CC @mkArtakMSFT

This issue was made automatically. If there is a problem contact ryanbrandenburg.

ryanbrandenburg commented 6 years ago

Please use this workflow to address this flaky test issue, including checking applicable checkboxes and filling in the applicable "TODO" entries:

This comment was made automatically. If there is a problem contact ryanbrandenburg.

mkArtakMSFT commented 6 years ago

@NTaylorMullen, can you please look into this? Thanks!

NTaylorMullen commented 6 years ago

Adding logging. @mkArtakMSFT @ryanbrandenburg how should I label this issue while we wait for more test failures with added logging?

ryanbrandenburg commented 6 years ago

Personally I would say:

  1. Label it blocked.
  2. Wait a couple days to see if it happens again. a. If it happens again use your new logs to figure out what's up. b. If it doesn't close the bug for now, the bot will open a new one when it happens.

@Eilon in case he wants to countermand that workflow. We might work that into the checklist if it's unclear.

aspnet-hello commented 6 years ago

CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions failed with about the same error on master.

This comment was made automatically. If there is a problem contact ryanbrandenburg.

Eilon commented 6 years ago

@NTaylorMullen is this the same failure as before? Does the new logging provide useful info?

NTaylorMullen commented 6 years ago

@NTaylorMullen is this the same failure as before? Does the new logging provide useful info?

Well it ruled out the one cause I thought possible 😲 . Now I gotta consider other possibilities.

aspnet-hello commented 6 years ago

There were 1 failures with about the same error on master:

This comment was made automatically. If there is a problem contact ryanbrandenburg.

Eilon commented 6 years ago

@NTaylorMullen - I see one MVC failure on the latest run:

[17:45:45] :     [Step 3/3]   Mvc                   |   [xUnit.net 00:00:39.36]     Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationWithCultureTest.CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions [FAIL]
[17:45:45] :     [Step 3/3]   Mvc                   |   Failed   Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationWithCultureTest.CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions
[17:45:45] :     [Step 3/3]   Mvc                   |   Error Message:
[17:45:45] :     [Step 3/3]   Mvc                   |    Unexpected correlation Id, reading values from document:
[17:45:45] :     [Step 3/3]   Mvc                   |   <html><head></head><body><h2 id="culture">fr-FR</h2>
[17:45:45] :     [Step 3/3]   Mvc                   |   <h2 id="ui-culture">fr-FR</h2>
[17:45:45] :     [Step 3/3]   Mvc                   |   <span id="correlation-id">14</span>
[17:45:45] :     [Step 3/3]   Mvc                   |   
[17:45:45] :     [Step 3/3]   Mvc                   |       <span id="cached-correlation-id">14</span>
[17:45:45] :     [Step 3/3]   Mvc                   |   
[17:45:45] :     [Step 3/3]   Mvc                   |   </body></html>
[17:45:45] :     [Step 3/3]   Mvc                   |   Stack Trace:
[17:45:45] :     [Step 3/3]   Mvc                   |      at Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationWithCultureTest.CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions() in /_/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs:line 163
[17:45:45] :     [Step 3/3]   Mvc                   |   --- End of stack trace from previous location where exception was thrown ---

...

[18:04:15] :     [Step 3/3]   SignalR               |         Finished test ServerThrowsHubExceptionOnStreamingHubMethodArgumentCountMismatch_messagepack_LongPolling_default in 0.0258653s
[18:04:16] :     [Step 3/3]   SignalR               |   System.Exception: Failed to bind Stream Item arguments to proper type.
[18:04:16] :     [Step 3/3]   SignalR               |      at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
[18:04:16] :     [Step 3/3]   SignalR               |      at System.Threading.Tasks.ValueTask`1.get_Result()
[18:04:16] :     [Step 3/3]   SignalR               |      at Microsoft.AspNetCore.SignalR.Tests.MethodHub.TestTypeCastingErrors(ChannelReader`1 source) in /_/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Hubs.cs:line 231
[18:04:18] :     [Step 3/3]   SignalR               |   [xUnit.net 00:00:11.49]     Microsoft.AspNetCore.SignalR.Redis.Tests.RedisEndToEndTests.CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser(transportType: LongPolling, protocolName: "json") [FAIL]
[18:04:18] :     [Step 3/3]   SignalR               |   Failed   Microsoft.AspNetCore.SignalR.Redis.Tests.RedisEndToEndTests.CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser(transportType: LongPolling, protocolName: "json")
[18:04:18] :     [Step 3/3]   SignalR               |   Error Message:
[18:04:18] :     [Step 3/3]   SignalR               |    System.TimeoutException : Operation in CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser timed out at /_/test/Microsoft.AspNetCore.SignalR.Redis.Tests/RedisEndToEnd.cs:118
[18:04:18] :     [Step 3/3]   SignalR               |   Stack Trace:
[18:04:18] :     [Step 3/3]   SignalR               |      at System.Threading.Tasks.TaskExtensions.OrTimeout[T](Task`1 task, TimeSpan timeout, String memberName, String filePath, Nullable`1 lineNumber) in /_/test/Microsoft.AspNetCore.SignalR.Tests.Utils/TaskExtensions.cs:line 67
[18:04:18] :     [Step 3/3]   SignalR               |      at Microsoft.AspNetCore.SignalR.Redis.Tests.RedisEndToEndTests.CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser(HttpTransportType transportType, String protocolName) in /_/test/Microsoft.AspNetCore.SignalR.Redis.Tests/RedisEndToEnd.cs:line 118
[18:04:18] :     [Step 3/3]   SignalR               |   --- End of stack trace from previous location where exception was thrown ---

And @anurse , I'm also seeing a bunch of these SignalR + Redis failures:

[18:05:04]E:         [VSTest] Runner error: [xUnit.net 00:00:31.73]     Microsoft.AspNetCore.SignalR.Redis.Tests.RedisEndToEndTests.CanSendAndReceiveUserMessagesFromMultipleConnectionsWithSameUser(transportType: LongPolling, protocolName: "messagepack") [FAIL]

@anurse - any idea on that?

BrennanConroy commented 6 years ago

@Eilon Those are filed on SignalR by the bot

Eilon commented 6 years ago

Ah OK so just @NTaylorMullen needs to look at the MVC stuff.

mkArtakMSFT commented 5 years ago

@NTaylorMullen, is this test still failing?

NTaylorMullen commented 5 years ago

Last failure was a while ago but I wrote some code in MVC to make it possible to diagnose why it's failing. I've seen it fail twice but it is uncommon. My bet is that it's still flakey, just not as flakey as some of our other flakey tests that we've seen in the past. I'd vote for leaving this open a while longer

NTaylorMullen commented 5 years ago

Ah, actually this is a duplicate. Tracking this here: https://github.com/aspnet/AspNetCore-Internal/issues/1337

halter73 commented 6 months ago

We got a new test failure here:

Error message:

Unexpected correlation Id, reading values from document:

<html><head></head><body>
fr-FR

fr-FR

14
<span id="cached-correlation-id">14</span>

</body></html>

Stack trace:

   at Microsoft.AspNetCore.Mvc.FunctionalTests.HtmlGenerationWithCultureTest.CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions() in /_/src/Mvc/test/Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs:line 171
--- End of stack trace from previous location ---

https://dev.azure.com/dnceng-public/public/_build/results?buildId=655364&view=ms.vss-test-web.build-test-results-tab&runId=16222964&resultId=124372&paneView=debug

A clue here is that 5 other tests failed with 100 second HttpClient timeouts, so the CI server was clearly running slower than normal. I think that the CacheTagHelper.DefaultExpiration of 30 seconds is to blame.

halter73 commented 5 months ago

See #55930 for more details on the very similar CacheTagHelper_AllowsVaryingByUICulture failure.