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

17.11+ System.IO.IOException: Connection forcibly closed by remote host #10402

Open
Sterlinghv opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@Sterlinghv
Copy link

Issue Description

After upgrading Microsoft.NET.Test.Sdk from version 17.10.0 to 17.11.0, our AzureDevOps test pipeline task encounters a System.IO.IOException at the very beginning of the run.

Steps to Reproduce

Use Microsoft.NET.Test.Sdk version 17.11.0 or above
Run dotnet test via the DotNetCoreCLI@2 in an AzureDevOps pipeline:

  - task: DotNetCoreCLI@2
    displayName: dotnet test
    inputs:
      command: test
      projects: <project solution>

Expected Behavior

Test run as expected with no IO exception at the start

Actual Behavior

Error seen in the AzureDevops test pipeline log:

System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host..
 ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.Flush()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.WriteAndFlushToChannel(String rawMessage) in /_/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs:line 413
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestSender.SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, Boolean isCancelled) in /_/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs:line 155
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection.ProxyDataCollectionManager.<>c__DisplayClass20_0.<AfterTestRunEnd>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs:line 155
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection.ProxyDataCollectionManager.InvokeDataCollectionServiceAction(Action action, ITestMessageEventHandler runEventsHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs:line 288

Environment

Windows Server 2016 inside a AzureDevOps agent pipeline job

Additional Notes

This is not happening on version 17.10.0 or presumably earlier. Seems to be happening at ProxyDataCollectionManager.cs line 288

I'm not sure what is trying to be written/connected when the issue happens

@nohwnd
Copy link
Member

nohwnd commented Oct 24, 2024

Hello, this error is a red herring, it means that the other process died unexpectedly. Please collect diagnostic logs and post them here:

https://github.com/Microsoft/vstest/blob/main/docs/diagnose.md

Or if they contain private information, please create a visual studio feedback issue and upload them there, you can share logs there privately.

If you are unable to share them, please look into the .host..log for exceptions. Please start from the bottom, it should be the last exception that happens. OR if you see just heartbeat and then the process dies, then it was killed externally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants