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

Connection error in VS on vstest.console exit #48

Closed
codito opened this issue Sep 8, 2016 · 2 comments
Closed

Connection error in VS on vstest.console exit #48

codito opened this issue Sep 8, 2016 · 2 comments
Assignees
Labels

Comments

@codito
Copy link
Contributor

codito commented Sep 8, 2016

Description

TranslationLayer throws an error on the communication channel if vstest.console exits

Steps to reproduce

  1. "Run All" from test explorer on a unit test project
  2. Terminate the vstest.console.exe process
  3. "Run All" on the same project

Expected behavior

Run All should work on step 3

Actual behavior

Following error is thrown:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.Stream.WriteByte(Byte value)
   at System.IO.BinaryWriter.Write(Byte value)
   at System.IO.BinaryWriter.Write7BitEncodedInt(Int32 value)
   at System.IO.BinaryWriter.Write(String value)
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.WriteAndFlushToChannel(String rawMessage) in D:\dd\gh\Microsoft\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\SocketCommunicationManager.cs:line 241
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.SendMessage(String messageType, Object payload) in D:\dd\gh\Microsoft\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\SocketCommunicationManager.cs:line 202
   at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleRequestSender.DiscoverTests(IEnumerable`1 sources, String runSettings, ITestDiscoveryEventsHandler eventHandler) in D:\dd\gh\Microsoft\vstest\src\Microsoft.TestPlatform.VsTestConsole.TranslationLayer\VsTestConsoleRequestSender.cs:line 107
   at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.DiscoverTests(IEnumerable`1 sources, String discoverySettings, ITestDiscoveryEventsHandler discoveryEventsHandler) in D:\dd\gh\Microsoft\vstest\src\Microsoft.TestPlatform.VsTestConsole.TranslationLayer\VsTestConsoleWrapper.cs:line 104

Similar behaviour for Debug All Scenario is observed as well.

Environment

vstest.console from 576f536 bits.

@codito
Copy link
Contributor Author

codito commented Sep 9, 2016

Translation layer also needs to clean up current session on communication failure.

@codito codito added the bug label Sep 22, 2016
codito pushed a commit that referenced this issue Oct 5, 2016
* Fix for indefinite waiting in IDE on testhost crash and show error message in IDE output window
* Monitor process exit of child vstest.console and start the runner process if not running from translation layer
* Allow for async receive message in communication layer

Fix #66, #48 and #61.
@codito
Copy link
Contributor Author

codito commented Oct 5, 2016

Fixed with 668257f

@codito codito closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants