microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.33k stars 1.19k forks source link

Cannot restart unit test #23913

Open iiwolf opened 3 months ago

iiwolf commented 3 months ago

Type: Bug

Behaviour

When trying to restart a Python unit test, unit test adatper crashes with "Error: Could not connect to RUN_TEST_IDS_PIPE: [Errno 2] No such file or directory: '\\.\pipe\python-test-ids-20dfe7a7d2563588ca21-sock'"

This started recently after a VSCode or Python extension update specifically, not sure which. My Python environment and version has stayed the same. I've uninstalled all other extensions, cleared cache, and restarted VSCode. This now occurs on multiple machines, both at home and at work. Been a month or two now and I've just been dealing with it.

Steps to reproduce:

  1. Debug Python unit test and hit breakpoint
  2. Click restart or CTRL+SHIFT+5

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` Error: Could not connect to RUN_TEST_IDS_PIPE: [Errno 2] No such file or directory: '\\\\.\\pipe\\python-test-ids-a73e2016afb4903ed58f-sock' Traceback (most recent call last): File "c:\Users\WolfI\.vscode\extensions\ms-python.python-2024.12.2-win32-x64\python_files\unittestadapter\execution.py", line 294, in with socket_manager.PipeManager(run_test_ids_pipe) as sock: File "c:\Users\WolfI\.vscode\extensions\ms-python.python-2024.12.2-win32-x64\python_files\testing_tools\socket_manager.py", line 17, in __enter__ return self.connect() File "c:\Users\WolfI\.vscode\extensions\ms-python.python-2024.12.2-win32-x64\python_files\testing_tools\socket_manager.py", line 24, in connect self._writer = open(self.name, "w", encoding="utf-8") # noqa: SIM115, PTH123 FileNotFoundError: [Errno 2] No such file or directory: '\\\\.\\pipe\\python-test-ids-a73e2016afb4903ed58f-sock' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\WolfI\Anaconda3\envs\clean-3.10.13\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\WolfI\Anaconda3\envs\clean-3.10.13\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\__main__.py", line 39, in cli.main() File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "c:\Users\WolfI\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "c:\Users\WolfI\.vscode\extensions\ms-python.python-2024.12.2-wi ```

Extension version: 2024.12.2 VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z) OS version: Windows_NT x64 10.0.19045 Modes:

User Settings

``` languageServer: "Pylance" testing • unittestArgs: "" • unittestEnabled: true ```

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |JavaScript Debugger|ms-vscode.js-debug|1.92.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.3| |Pylance|ms-python.vscode-pylance|2024.7.1| |Python|ms-python.python|2024.12.2| |Python Debugger|ms-python.debugpy|2024.10.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9|
System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) W-11855M CPU @ 3.20GHz (12 x 3187)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|63.21GB (44.45GB free)| |Process Argv|--folder-uri file:///c%3A/Users/WolfI/projects/misc/mre/cant_restart_vscode_tests --crash-reporter-id eedcbace-8dcd-4492-aada-8260e9525837| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 0ee40948:31013168 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 refactort:31108082 ccpltc:31103427 pythonrstrctxtcf:31103194 wkspc-onlycs-c:31106320 ```
iiwolf commented 3 months ago

Also, when I use "Python: report an issue" from VSCode, the template above has the behavior and steps to reproduce sections duplicated? Is that intentional? I even restarted the process to make sure I didn't do something wrong, but it still did it. I deleted it as it made things messy.

iiwolf commented 3 months ago

While the error message is different I found the thread discussing a similar issue: https://github.com/microsoft/vscode-python-debugger/issues/338#issue-2282060194

As you can see I actually even commented on this (/facepalm) but couldn't find the thread again after coming back from vacation!

I see you are assigned to that one as well @eleanorjboyd. I'll leave it up to you to close this one if you think it's the same or leave it open for the time being.

Thanks!

sahilmodi commented 3 months ago

I am also seeing this issue

eleanorjboyd commented 1 month ago

this should be fixed by our work on this issue: https://github.com/microsoft/vscode-python/issues/23279