Skip to content
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

[Bug]: Several MSBuild unit tests are failing with terminal logger enabled #9796

Closed
ladipro opened this issue Feb 28, 2024 · 1 comment · Fixed by #9995
Closed

[Bug]: Several MSBuild unit tests are failing with terminal logger enabled #9796

ladipro opened this issue Feb 28, 2024 · 1 comment · Fixed by #9995
Assignees
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@ladipro
Copy link
Member

ladipro commented Feb 28, 2024

Issue Description

I feel like this is already tracked somewhere but can't find it.

Microsoft.Build.Engine.UnitTests:

0.7754982s✘ Microsoft.Build.UnitTests.TerminalLoggerConfiguration_Tests.TerminalLoggerOnByEnv(envVarSource: \"MSBUILDLIVELOGGER\")
Shouldly.ShouldAssertException : superset.Contains(key)\r\n    should be\r\nTrue\r\n    but was\r\nFalse\r\n\r\nAdditional Info:\r\n    environment variable removed: MSBUILDLIVELOGGER
   at Microsoft.Build.UnitTests.EnvironmentInvariant.<AssertInvariant>g__AssertDictionaryInclusion|2_0(IDictionary superset, IDictionary subset, String operation) in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 434
   at Microsoft.Build.UnitTests.EnvironmentInvariant.AssertInvariant(ITestOutputHelper output) in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 424
   at Microsoft.Build.UnitTests.TestEnvironment.Cleanup() in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 95
   at Microsoft.Build.UnitTests.TestEnvironment.Dispose() in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 68
   at Microsoft.Build.UnitTests.TerminalLoggerConfiguration_Tests.Dispose() in C:\src\msbuild\src\Build.UnitTests\TerminalLoggerConfiguration_Tests.cs:line 51
   at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 79

Microsoft.Build.CommandLine.UnitTests:

0.1690553s✘ Microsoft.Build.Engine.UnitTests.MSBuildServer_Tests.BuildsWhileBuildIsRunningOnServer
System.AggregateException : One or more errors occurred.\r\n---- System.FormatException : Input string was not in a correct format.\r\n---- A file expected as an output does not exist: C:\\Users\\laprosek\\AppData\\Local\\Temp\\5czuhebl.mqs\\MSBuildTemp\\tmp4057706171da4d4a91df81e654793a2e.tmp\r\nExpected: True\r\nActual:   False
----- Inner Stack Trace #1 (System.FormatException) -----
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Int32.Parse(String s)
   at Microsoft.Build.Engine.UnitTests.MSBuildServer_Tests.ParseNumber(String searchString, String toFind) in C:\src\msbuild\src\MSBuild.UnitTests\MSBuildServer_Tests.cs:line 348
   at Microsoft.Build.Engine.UnitTests.MSBuildServer_Tests.BuildsWhileBuildIsRunningOnServer() in C:\src\msbuild\src\MSBuild.UnitTests\MSBuildServer_Tests.cs:line 190
----- Inner Stack Trace #2 (Xunit.Sdk.TrueException) -----
   at Microsoft.Build.UnitTests.TransientTestFile.Revert() in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 691
   at Microsoft.Build.UnitTests.TestEnvironment.Cleanup() in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 89
   at Microsoft.Build.UnitTests.TestEnvironment.Dispose() in C:\src\msbuild\src\UnitTests.Shared\TestEnvironment.cs:line 68
   at Microsoft.Build.Engine.UnitTests.MSBuildServer_Tests.Dispose() in C:\src\msbuild\src\MSBuild.UnitTests\MSBuildServer_Tests.cs:line 90
   at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in /_/src/xunit.execution/Extensions/ReflectionAbstractionExtensions.cs:line 79
Output:
Executing [C:\src\msbuild\artifacts\bin\Microsoft.Build.CommandLine.UnitTests\Debug\net472\MSBuild.exe C:\Users\laprosek\AppData\Local\Temp\5czuhebl.mqs\MSBuildTemp\Temporary6095b3e82d274a3f9165c921da46cf74\testProject.proj]
==== OUTPUT ====
MSBuild version 17.10.0-dev-24128-01+eec991b08 for .NET Framework
\x1b]9;4;3;\x1b\\x1b[?25l\x1b[1F
\x1b[?25h
Build \x1b[32;1msucceeded\x1b[m in 0.0s
\x1b]9;4;0;\x1b\

.. and more.

Steps to Reproduce

C:\src\msbuild>SET MSBUILDLIVELOGGER=auto
C:\src\msbuild>build -test

Expected Behavior

Tests succeed.

Actual Behavior

Some tests fail.

Analysis

No response

Versions & Configurations

MSBuild at commit 6f44380

@ladipro ladipro added bug needs-triage Have yet to determine what bucket this goes in. labels Feb 28, 2024
@ladipro
Copy link
Member Author

ladipro commented Feb 28, 2024

This should be considered for March 2024 iteration, cc @rokonec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
3 participants