TemplateStudio
TemplateStudio copied to clipboard
UITestMethods fail in GitHub Actions CI
Describe the bug
UITestMethods fail in GitHub Actions CI (and possibly others). Commenting out UITestMethods allows the test pass to run and succeed. The same project with UITestMethods works fine when run locally in VS and from the CLI with the same commands used in the pipeline.
See additional context below for the exception. Working with the MSTest team on this as it may be a platform issue.
To Reproduce
https://github.com/mikebattista/TemplateStudio-MSTest-CI-RC
Fail with UITestMethod: https://github.com/mikebattista/TemplateStudio-MSTest-CI-RC/actions/runs/2735417690 Pass without UITestMethod: https://github.com/mikebattista/TemplateStudio-MSTest-CI-RC/actions/runs/2735455045
The pipeline is using the windows-latest Microsoft-hosted agent.
Additional context
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" ${env:Test_Project_Name}\bin\x64\Debug\**\${env:Test_Project_Name}.dll
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
Solution_Name: App1.sln
Project_Name: App1
Test_Project_Name: App1.Tests.MSTest
DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
Microsoft (R) Test Execution Command Line Tool Version 17.2.0-preview-20220401-07 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
The active test run was aborted. Reason: Test host process crashed
Test Run Aborted with error System.AggregateException: One or more errors occurred. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int[3](https://github.com/mikebattista/TemplateStudio-MSTest-CI-RC/runs/7510971867?check_suite_focus=true#step:7:3)2 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.Stream.ReadByte()
at System.IO.BinaryReader.ReadByte()
at System.IO.BinaryReader.Read[7](https://github.com/mikebattista/TemplateStudio-MSTest-CI-RC/runs/7510971867?check_suite_focus=true#step:7:7)BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken)
--- End of inner exception stack trace ---.
Error: Process completed with exit code 1.
Applies to the following platforms:
- [X] WinUI
- [ ] WPF
- [ ] UWP
About your setup
- Visual Studio Version:
- Template Studio Wizard Version:
- Windows Build: