vstest
vstest copied to clipboard
Throws System.IO.EndOfStreamException when System.IO.Ports is installed and tests are running under alpine image in CI
Description
Integration tests with WebApplicationFactory
fails on CI pipeline of gitlab after installing package System.IO.Ports:
TpTrace Error: 0 : 385, 10, 2023/05/11, 06:14:38.017, 1379116481548190, vstest.console.dll, Socket: Message loop: failed to receive message due to socket error System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.Read7BitEncodedInt()
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), remoteEndPoint: 127.0.0.1:36194 localEndPoint: 127.0.0.1:42717
I'm using docker image mcr.microsoft.com/dotnet/sdk:6.0-alpine3.17 to run tests. This error has appeared right after installation of System.IO.Ports NuGet package and it happers only for integration tests. I've tried to run it under Debian based image and tests pass successffully. Possible it is not an issue of vstest. An investigation is required.
Steps to reproduce
- Create ASP.NET project
- Install there System.IO.Ports NuGet package
- Create project with test and cover with test some of the API methods using
WebApplicationFactory
(Microsoft.AspNetCore.Mvc.Testing NuGet package) - Run tests in docker using mcr.microsoft.com/dotnet/sdk:6.0-alpine3.17
Expected behavior
Integration tests run as usually without any errors underhood
Actual behavior
Got System.IO.EndOfStreamException as I wrote in the description
Diagnostic logs
Not attached. If need I can try to reproduce it on some kind of pet project and send logs.
Environment
Docker image: mcr.microsoft.com/dotnet/sdk:6.0-alpine3.17
Running it with --diag:logs/ will give more info on what happened. There should be more items in that log folder, especially .host. log.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 10 days.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 10 days.