Closed xaviergmail closed 4 months ago
Which version of the extension are you using?
This no longer happens for me.
This happens for me. Detaching a debugger during a breakpoint pause causes the extension to hang.
The debugger works great now with #334, but we have a problem with "Restart" button.
@connor4312 do you know if it's possible to do an action before the debugger attaches itself when "Restart" button is clicked? I need to stop the previous inspector session before the new one attaches, and I wasn't able to find a solution using pwa-node:attach
. I found a hidden preRestartTask
option, but it's called too late - the new debug session is already attached by the time it's called.
I am experimenting in this PR: https://github.com/vitest-dev/vscode/pull/334 You can reproduce this behavior like this:
pnpm run compile
add.test.ts
fileIf someone can help me out here, that would be great. If something needs to be done on Vitest's side for this to work, this is also fine.
For me to be able to look at this a bit maybe over the weekend, I need to understand: How did this work before the rewrite of the extension, and why? Or maybe it didn't?
For me to be able to look at this a bit maybe over the weekend, I need to understand: How did this work before the rewrite of the extension, and why? Or maybe it didn't?
Before the rewrite, the extension was using pwa-node:launch
debug configuration to spawn a new Vitest process. We now have an integration in Vitest to open an inspector in the process where the test is running.
And the original issue description, is that for the new extension or the old, released version?
And the original issue description, is that for the new extension or the old, released version?
The original issue is about the pre-release version as you can see in the screenshot tests are rendered as a test tree which was not supported in the 0.4.0 (they were rendered as a list).
And the original issue description, is that for the new extension or the old, released version?
The original issue is about the pre-release version as you can see in the screenshot tests are rendered as a test tree which was not supported in the 0.4.0 (they were rendered as a list).
Aha.
I can't help but think we should maybe (for now, temporarily) make the debug functionality as it was in the old version (if possible).
Just to get to feature completion and get all of this unrealized great value out.
And then get the new method fixed afterwards.
What are your thoughts on this?
I am going to release the rewritten debugger this week anyway. The only thing that doesn't work is "Restart" button, but you can always detach and start a new debug session.
I specifically asked @connor4312 because he was working on the JS debugger in vscode and maybe has some insights on this specific problem, but it doesn't block release. The only thing that was blocking release was Vitest 1.5.0 which I published yesterday.
Ah that's awesome! 😍
do you know if it's possible to do an action before the debugger attaches itself when "Restart" button is clicked?
Playwright asked about the same thing for the same scenario in their tests. I think I started working on a branch locally at one point but never finished it... tracked here https://github.com/microsoft/vscode/issues/210304
do you know if it's possible to do an action before the debugger attaches itself when "Restart" button is clicked?
Playwright asked about the same thing for the same scenario in their tests. I think I started working on a branch locally at one point but never finished it... tracked here microsoft/vscode#210304
Thank you for looking into this 🙏🏻
Describe the bug
After running a test in debug mode
Reproduction
Can't really reproduce on StackBlitz. I can reproduce it on the basic example. The only modification is my
vite.config.ts
specifies this:Debug a test with a breakpoint![image](https://github.com/vitest-dev/vscode/assets/522034/bbfcace9-8e7b-41cd-81ac-ddf9efd2d8b4)
Once paused on the breakpoint, hit either "Disconnect" or "Stop" from the debug panel![image](https://github.com/vitest-dev/vscode/assets/522034/718cfd52-9ed7-4609-a5bc-06526482a312)
Notice the test keeps the spinning running icon:![image](https://github.com/vitest-dev/vscode/assets/522034/f3f44e1e-d6c0-4162-ad63-04bea5442b27)
Right click the same test -> Debug test, this works and it can be re-run
Right click -> Run test (NOT debug) (or run test from test explorer view)![image](https://github.com/vitest-dev/vscode/assets/522034/abfa28d2-d94f-47f6-b3d4-097edb899575)
Notice it never runs![image](https://github.com/vitest-dev/vscode/assets/522034/27dbc565-d578-462f-91a8-638a4e059d31)
Right click the same test -> Debug test, this no longer works either and they just keep queuing up
This also seems to happen if the test being debugged fails.
I am unable to run any other test using the regular run config after that without reloading the editor window.
vitest extension logs
[INFO 12:54:29 AM] [Vitest] Extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace. [INFO 12:54:29 AM] [API] Running Vitest: v1.4.0 (/Volumes/projects/modular-bundles/extensions/modular-bundles/vite.config.js), v1.4.0 (/Volumes/projects/modular-bundles/vite.config.ts) [INFO 12:54:31 AM] [API] Vitest process 79597 created [INFO 12:54:34 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [Worker] Debugger listening on ws://127.0.0.1:9229/347ba504-6379-4364-99d0-40b58524e7e8 For help, see: https://nodejs.org/en/docs/inspector [Worker] Debugger attached. [INFO 12:54:38 AM] [DEBUG] Debugging started [INFO 12:54:38 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [INFO 12:54:39 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [Worker] Debugger ending on ws://127.0.0.1:9229/347ba504-6379-4364-99d0-40b58524e7e8 For help, see: https://nodejs.org/en/docs/inspector [INFO 12:57:04 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [INFO 12:57:04 AM] [API] Running Vitest: v1.4.0 (/Volumes/projects/modular-bundles/extensions/modular-bundles/vite.config.js), v1.4.0 (/Volumes/projects/modular-bundles/vite.config.ts) [INFO 12:57:05 AM] [API] Vitest process 80839 created [Worker] Debugger listening on ws://127.0.0.1:9229/2faac4d4-5ac3-4cdd-ba0d-3766f4a55a6f For help, see: https://nodejs.org/en/docs/inspector [Worker] Debugger attached. [INFO 12:57:19 AM] [DEBUG] Debugging started [INFO 12:57:19 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [INFO 12:57:20 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [Worker] Debugger ending on ws://127.0.0.1:9229/2faac4d4-5ac3-4cdd-ba0d-3766f4a55a6f For help, see: https://nodejs.org/en/docs/inspector [INFO 12:57:26 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [Worker] Debugger listening on ws://127.0.0.1:9229/ad9d6116-c4a3-4f95-af6b-38c7f43a1f85 For help, see: https://nodejs.org/en/docs/inspector [Worker] Debugger attached. [INFO 12:57:43 AM] [DEBUG] Debugging started [INFO 12:57:44 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [INFO 12:57:44 AM] Running 1 file(s) with name pattern: ^\s?findMigrations finds all files$ [Worker] Debugger ending on ws://127.0.0.1:9229/ad9d6116-c4a3-4f95-af6b-38c7f43a1f85 For help, see: https://nodejs.org/en/docs/inspector [Error 1:00:10 AM] [API] [Error Error] Channel closed Error: Channel closed at new NodeError (node:internal/errors:405:5) at ChildProcess.send (node:internal/child_process:740:16) at post (/Users/xavier/.vscode/extensions/vitest.explorer-0.5.9/dist/extension.js:3:2594) at /Users/xavier/.vscode/extensions/vitest.explorer-0.5.9/dist/extension.js:3:1068 at new Promise ()
at Proxy.b (/Users/xavier/.vscode/extensions/vitest.explorer-0.5.9/dist/extension.js:3:823)
System Info