microsoft / vstest

Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
MIT License
870 stars 316 forks source link

Upgrade to Visual Studio 17.10.x now has internal exception in Azure DevOps log #5124

Open tasketechnology opened 3 days ago

tasketechnology commented 3 days ago

Description

After upgrading Visual Studio 2022 to 17.10.x on our self-hosted agent DevOps Pipeline task for GoogleTest fails. All of the test succeed but there's an internal error to the Vstest.Cosole.exe extension which writes to stderr.

Steps to reproduce

Upgrade Visual Studio to the latest 17.10.3 (issued started with 17.10.0). Create a GoogleTest and a DevOps task to run it. It does not matter if you select Visual Studio from the dropdown or specify the actuall path Vstest.console.exe. The exception is logged when the all tests have been, and all passed.

Expected behavior

No internal exceptions to the stderr for internal errors? An stderr output will cuase a DevOps task to fail.

Actual behavior

DevOps task C++task fails even though all tess passed. The internal error writes to stderr which automatically fails a DevOps task.

Diagnostic logs

Here's the portion of the log of the Devops task with extra debugging enabled.

2024-06-17T12:10:18.9646936Z Google Test execution completed, overall duration: 00:00:18.1881422 2024-06-17T12:10:19.1201970Z ##[error]An exception occurred while invoking executor 'executor://codedwebtestadapter/v1': The type initializer for 'Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.Constants' threw an exception. 2024-06-17T12:10:19.1208806Z ##[debug]Processed: ##vso[task.logissue type=error;]An exception occurred while invoking executor 'executor://codedwebtestadapter/v1': The type initializer for 'Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.Constants' threw an exception. 2024-06-17T12:10:19.1212634Z ##[error]Stack trace: 2024-06-17T12:10:19.1213510Z ##[debug]Processed: ##vso[task.logissue type=error;]Stack trace: 2024-06-17T12:10:19.1214915Z ##[error] at Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.TmiBridge..ctor() 2024-06-17T12:10:19.1216617Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.TmiBridge..ctor() 2024-06-17T12:10:19.1219939Z ##[error] at Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.CodedWebTestExecutor.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) 2024-06-17T12:10:19.1226584Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.Extensions.CodedWebTestAdapter.CodedWebTestExecutor.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) 2024-06-17T12:10:19.1243410Z ##[error] at Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in /_/src/Microsoft.TestPlatform.Common/ExtensionDecorators/SerialTestRunDecorator.cs:line 59 2024-06-17T12:10:19.1254007Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in //src/Microsoft.TestPlatform.Common/ExtensionDecorators/SerialTestRunDecorator.cs:line 59 2024-06-17T12:10:19.1264947Z ##[error] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension2 executor, Tuple2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle) in //src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs:line 116 2024-06-17T12:10:19.1270820Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension2 executor, Tuple2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs:line 116 2024-06-17T12:10:19.1279085Z ##[error] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>cDisplayClass46_0.b_0() in //src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 464 2024-06-17T12:10:19.1285928Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>cDisplayClass46_0.b0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 464 2024-06-17T12:10:19.1307550Z ##[error] at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b0() in /_/src/Microsoft.TestPlatform.PlatformAbstractions/net462/System/PlatformThread.cs:line 29 2024-06-17T12:10:19.1312187Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b_0() in //src/Microsoft.TestPlatform.PlatformAbstractions/net462/System/PlatformThread.cs:line 29 2024-06-17T12:10:19.1315387Z ##[error]--- End of stack trace from previous location where exception was thrown --- 2024-06-17T12:10:19.1317372Z ##[debug]Processed: ##vso[task.logissue type=error;]--- End of stack trace from previous location where exception was thrown --- 2024-06-17T12:10:19.1319254Z ##[error] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2024-06-17T12:10:19.1321237Z ##[debug]Processed: ##vso[task.logissue type=error;] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 2024-06-17T12:10:19.1326046Z ##[error] at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion) in //src/Microsoft.TestPlatform.PlatformAbstractions/net462/System/PlatformThread.cs:line 47 2024-06-17T12:10:19.1330610Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion) in //src/Microsoft.TestPlatform.PlatformAbstractions/net462/System/PlatformThread.cs:line 47 2024-06-17T12:10:19.1335637Z ##[error] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInStaThread(Action action, Boolean waitForCompletion) in //src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 680 2024-06-17T12:10:19.1339286Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInStaThread(Action action, Boolean waitForCompletion) in //src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 680 2024-06-17T12:10:19.1344082Z ##[error] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable1 executorUriExtensionMap, Int64 totalTests) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 464 2024-06-17T12:10:19.1347584Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable1 executorUriExtensionMap, Int64 totalTests) in //src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 464 2024-06-17T12:10:19.1350784Z ##[error]Inner exception: Cannot register property 'TestType' as value type 'System.Guid' because it was already registered as 'System.String'. 2024-06-17T12:10:19.1352939Z ##[debug]Processed: ##vso[task.logissue type=error;]Inner exception: Cannot register property 'TestType' as value type 'System.Guid' because it was already registered as 'System.String'. 2024-06-17T12:10:19.1354180Z ##[error]Stack trace: 2024-06-17T12:10:19.1354866Z ##[debug]Processed: ##vso[task.logissue type=error;]Stack trace: 2024-06-17T12:10:19.1358336Z ##[error] at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty.Register(String id, String label, String category, String description, Type valueType, ValidateValueCallback validateValueCallback, TestPropertyAttributes attributes, Type owner) in //src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs:line 347 2024-06-17T12:10:19.1362036Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty.Register(String id, String label, String category, String description, Type valueType, ValidateValueCallback validateValueCallback, TestPropertyAttributes attributes, Type owner) in //src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs:line 347 2024-06-17T12:10:19.1365879Z ##[error] at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty.Register(String id, String label, Type valueType, TestPropertyAttributes attributes, Type owner) in //src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs:line 304 2024-06-17T12:10:19.1368411Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty.Register(String id, String label, Type valueType, TestPropertyAttributes attributes, Type owner) in /_/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs:line 304 2024-06-17T12:10:19.1370208Z ##[error] at Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.Constants..cctor() 2024-06-17T12:10:19.1371266Z ##[debug]Processed: ##vso[task.logissue type=error;] at Microsoft.VisualStudio.TestPlatform.Extensions.TmiHelper.Constants..cctor()

Environment

Windows 64-bit compile with C++ 20. This identical error occurs on our legacy product too with 32-bit aand C++ 14.