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

Right-click a test and click debug causes the indicator to spin forever. #357

Open
tarekahf opened this issue Mar 17, 2022 · 4 comments
Open

Comments

@tarekahf
Copy link

Steps to reproduce:

  1. Start VS Code
  2. Run the command to create NUnit Test
dotnet new unit --framwork net5.0
  1. Right-click a test, and click debug.

The wheel will spin forever, and I see the following in the output:

Executing dotnet test --no-build --logger "trx;LogFileName=C:\Users\username\AppData\Local\Temp\2\test-explorer-v2Ocg1\0.trx" --filter "FullyQualifiedName=tests.Tests.Test1" in c:/Projects/Jira/some-folder/tests
Process 48352 started
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach

Required info:

  1. Dotnet sdk version:
> dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.102
 Commit:    02d5242ed7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.102\

Host (useful for support):
  Version: 6.0.2
  Commit:  839cdfb0ec

.NET SDKs installed:
  5.0.302 [C:\Program Files\dotnet\sdk]
  5.0.405 [C:\Program Files\dotnet\sdk]
  6.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  1. Unit test framework and relevants versions of that:
    "NUnit" Version="3.13.1"
    "NUnit3TestAdapter" Version="3.17.0"

  2. Dot NET Core Test Explorer Extension: v0.7.7

If I run the tests normally, everything works fine.

Please help to resolve this issue.

Tarek

@tarekahf
Copy link
Author

Note that with xUnit it works fine. The debug from the tree works fine without any problem.

@PandaWood
Copy link

PandaWood commented Apr 14, 2022

I notice this debugging feature is in Alpha, according to the "Details" but yeah, debugging never works for me (I'm using NUnit also)

@dviererbe
Copy link

I wanted to debug a .NET 7 xUnit Test and I had the same problem. I could attach the debugger manually.

Workaround:
On Windows: Search for a process called "testhost.exe" in the TaskManager and use the PID to attach the debugger. After the process stops, the spinning will stop too.

@hbertsch
Copy link

hbertsch commented Mar 31, 2023

Same issue here.

  • PackageReference Include="nunit" Version="3.12.0"
  • VS Code Version: 1.77.0
  • TargetFramework net6.0
  • SDK Version 6.0.406

Result:

Executing dotnet build in /Users...
Executing dotnet test --no-build --logger "trx;LogFileName=/var/folders/3c/2fjmjtc575nds0x6l6lxsw_80000gn/T/test-explorer-HeMIaQ/0.trx" --filter "FullyQualifiedName=UnitTests.SerializerTests.ApiToOpbject" in /Users/...
Process 78997 started
Waiting for debugger to attach
Waiting for debugger to attach
Waiting for debugger to attach

Workaround

that worked for me is to start debugging by clicking on Debug Test in the code file view:
debugTest

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

4 participants