Test run aborted. Connection forcibly closed

I get the following errors when running unit tests on my solution. (R# 2018.2.3)

Individually the tests run fine. Interdependence between the tests has been ruled out by a number of other devs and indeed most of the tests have been commented out to fine tune which tests are causing the issue.

The tests run fine on the Azure gated build and locally under Test Explorer.

Any clues on this one? 

 

2018.10.02 13:31:22.972 WARN The active test run was aborted. Reason:
2018.10.02 13:31:24.925 ERROR Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. at System.Net.Sockets.NetworkStream.Read(Span`1 destination) at System.Net.Sockets.NetworkStream.ReadByte() at System.IO.BinaryReader.ReadByte() 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) Source: System.Net.Sockets HResult: -2146232800 Inner Exception: An existing connection was forcibly closed by the remote host HResult: -2147467259

--- EXCEPTION #1/1 [LoggerException]
Message = “
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.NetworkStream.Read(Span`1 destination)
at System.Net.Sockets.NetworkStream.ReadByte()
at System.IO.BinaryReader.ReadByte()
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)
Source: System.Net.Sockets
HResult: -2146232800

Inner Exception: An existing connection was forcibly closed by the remote host
HResult: -2147467259

ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.OnRunComplete(ExecutionCompletePayload payload)
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentActionHolder`1.Execute(Object argument)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.PerformActions(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

2018.10.02 13:31:24.978 WARN dotnet exited with exit code (1)
Output stream: Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation. All rights reserved.
Error stream:
2018.10.02 13:31:24.979 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests was left running after its run completion.
2018.10.02 13:31:24.980 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Empty_TransactionId_Throws_ArgumentException was left pending after its run completion.
2018.10.02 13:31:24.980 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.GetAsync_Call_To_StorageFactory_Passes_Correct_Parameters was left pending after its run completion.
2018.10.02 13:31:24.982 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.GetStorage_Receives_Correct_Connection_String was left pending after its run completion.
2018.10.02 13:31:24.982 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.StorageFactory_GetStorage_Returning_Null_Throws_NullReferenceException_And_Logs was left pending after its run completion.
2018.10.02 13:31:24.982 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Empty_StorageConnectionString_Throws_ArgumentException was left pending after its run completion.
2018.10.02 13:31:24.983 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Empty_StorageConnectionString_Throws_ArgumentException.Empty_StorageConnectionString_Throws_ArgumentException(null) was left pending after its run completion.
2018.10.02 13:31:24.983 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Empty_StorageConnectionString_Throws_ArgumentException.Empty_StorageConnectionString_Throws_ArgumentException("") was left pending after its run completion.
2018.10.02 13:31:24.983 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Null_EventLogger_Throws_ArgumentNullException was left pending after its run completion.
2018.10.02 13:31:24.986 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Null_StorageFactory_Throws_ArgumentNullException was left pending after its run completion.
2018.10.02 13:31:24.986 WARN Element companyName.ProductName.companyNameEngine.Business.Tests.L0.Storage.OriginalFileStoreTests.Empty_FileId_Throws_ArgumentException was left running after its run completion.

0
3 comments

Hello!

 

Thank you for contacting us.

Could you please run Visual Studio with the following command line: 'devenv /ReSharper.LogFile C:\resharper_log.txt /ReSharper.LogLevel Verbose', reproduce the issue and send us a corresponding 'resharper_log.txt' file.

You can share it privately via 'Submit a request' form. Please specify the link to this thread in request details.

Thank you.

0
Avatar
Permanently deleted user

Will do. 

For anyone else trying this I had to run Visual Studio as Admin before my solution would load.

I opened a command prompt as Admin and ran the command from there.

0

Have the same with R# 2018.3 on VS 2017 and VS 2019 (both with all updates)

Microsoft.NET.Test.Sdk 15.9.0 

 

Also, R# test runner can't recognize MS test sdk from time to time and it lasts until I manually remove obj/bin folders. 

Update: 
According to the logs entire test engine fails because of application's unhandled exception. After a fix everything works as expected. 
But I'm curious, about the inner reason. After all, I'm writing tests to detect issues by tool's explicit behavior, not by workarounds. 

 

0

Please sign in to leave a comment.