nunit3-vs-adapter icon indicating copy to clipboard operation
nunit3-vs-adapter copied to clipboard

`SocketException` ("can't assign requested address") when starting child process on 6.0.0

Open DaRosenberg opened this issue 3 months ago • 2 comments

We just upgraded to 6.0.0 and immediately ran into a tricky issue. Many of our tests invoke an external executable (either as part of setup, or as part of the test itself) and read its stdout output back into the test. Whenever we do this running in the new adapter, we get this exception while reading from the stdout stream:

System.IO.IOException : Can't assign requested address
  ----> System.Net.Sockets.SocketException : Can't assign requested address

Important: The exception only happens if the invoked executable actually writes anything to stderr. Additionally, it does not matter if our test code tries to read back stderr from the process or not.

  • The exception does not happen on 5.2.0 — same exact repro scenario works fine there
  • The exception happens on macOS and Linux, but not on Windows
  • The exception happens regardless whether we use MTP or VSTest

Here's a minimal repro project: nunit-6-repro.zip

Simply extract and do either dotnet run or dotnet test, and you'll see the issue.

DaRosenberg avatar Dec 10 '25 11:12 DaRosenberg

Thanks! We'll need to come back to you for checking this.

OsirisTerje avatar Dec 10 '25 18:12 OsirisTerje

Sure, happy to help in any way I can.

DaRosenberg avatar Dec 10 '25 19:12 DaRosenberg

@DaRosenberg Can you check https://www.nuget.org/packages/NUnit3TestAdapter/6.0.1-alpha.6

OsirisTerje avatar Dec 19 '25 13:12 OsirisTerje

v6.0.1-alpha.6 seems to fix the issue for me: https://github.com/PhilippNaused/Vilens/actions/runs/20377146042

PhilippNaused avatar Dec 19 '25 17:12 PhilippNaused

@OsirisTerje Yep, seems to work on 6.0.1-alpha.6.

DaRosenberg avatar Dec 19 '25 18:12 DaRosenberg