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

Quarantine WebHostFunctionalTests.LoggingConfigurationSectionPassedToLoggerByDefault #36079

Open TanayParikh opened 3 years ago

TanayParikh commented 3 years ago

Failing Test(s)

Error Message

System.AggregateException : An error occurred while writing to logger(s). (Assert.True() Failure\nExpected: True\nActual:   False)\n---- Assert.True() Failure\nExpected: True\nActual:   False

Stacktrace

```text at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions) at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) at Microsoft.AspNetCore.Tests.WebHostFunctionalTests.LoggingConfigurationSectionPassedToLoggerByDefault() in /_/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs:line 132 ----- Inner Stack Trace ----- at Microsoft.AspNetCore.Tests.WebHostFunctionalTests.<>c.b__6_1(String s, Exception e) in /_/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs:line 134 at Microsoft.Extensions.Logging.Console.SimpleConsoleFormatter.Write[TState](LogEntry`1& logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) at Microsoft.Extensions.Logging.Console.ConsoleLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) at Microsoft.Extensions.Logging.Logger.g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func`3 formatter, List`1& exceptions, TState& state) ```

Logs

```text | [0.000s] TestLifetime Information: Starting test LoggingConfigurationSectionPassedToLoggerByDefault at 2021-09-01T23:25:20 | [0.157s] Microsoft.AspNetCore.Tests.WebHostFunctionalTests Error: Test threw an exception. | System.AggregateException: An error occurred while writing to logger(s). (Assert.True() Failure | Expected: True | Actual: False) | ---> Xunit.Sdk.TrueException: Assert.True() Failure | Expected: True | Actual: False | at Xunit.Assert.True(Nullable`1 condition, String userMessage) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\BooleanAsserts.cs:line 95 | at Xunit.Assert.True(Boolean condition) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\BooleanAsserts.cs:line 62 | at Microsoft.AspNetCore.Tests.WebHostFunctionalTests.<>c.b__6_1(String s, Exception e) in /_/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs:line 134 | at Microsoft.Extensions.Logging.Console.SimpleConsoleFormatter.Write[TState](LogEntry`1& logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) | at Microsoft.Extensions.Logging.Console.ConsoleLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) | at Microsoft.Extensions.Logging.Logger.g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func`3 formatter, List`1& exceptions, TState& state) | --- End of inner exception stack trace --- | at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions) | at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) | at Microsoft.AspNetCore.Tests.WebHostFunctionalTests.LoggingConfigurationSectionPassedToLoggerByDefault() in /_/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs:line 132 | [0.241s] TestLifetime Information: Finished test LoggingConfigurationSectionPassedToLoggerByDefault in 0.2405036s ```

Build

https://dev.azure.com/dnceng/public/_build/results?buildId=1335605&view=ms.vss-test-web.build-test-results-tab&runId=39165748&resultId=100002&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

adityamandaleeka commented 3 years ago

Triage: The test seems racy now, should probably rewrite it to use a TaskCompletionSource to avoid this type of failure.