Repository navigation
Test Discovery Failing in all repos (for the Testing Panel) #23447
Description
Type: Bug
Behaviour
When trying to use the VSCode Testing from the sidepanel, Tests are not Discoverable due to a permissions error.
I first noticed this in a single repo I was working in. I opened up another repo to see if the error persisted and it did. Then I created a separate directory with a very simple example to test and the error still occurred there as well.
Example file structure:
├── app
│ ├── __init__.py
│ └── sum_nums.py
└── tests
├── __init__.py
└── test_sum_nums.pyAs far as I know, nothing has changed in my system, no major updates or upgrades have happened before or since this started happening. Perhaps a chmod is needed but I am hesitant to do that without knowing why.
Why is this only occuring now? Has there been a change to the files used for the Testing execution in the last few days/weeks?
I was able to restart my computer this morning, open up a repo and run 1 test via the VSCode Testing but it only allowed me to run the singlular test before showing the error again.
I aslo recreated my Virtual Enviroment but that did not work either.
Steps to reproduce:
- Open any repo with Python code and associated tests
- Select the
Testingtab in the side panel - In side-bar, message appears
Unittest Discovery Error - Open Up the
Outputstab toPython - See Discovery Error due to file lacking permissions (Please See Output Details Below For Outputted Error)
Tests CAN be run successfully from the command line: python -m unittest discover
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-05-17 09:48:08.086 [error] Unittest test discovery error for workspace: file:///home/sgomez/practice/error_example_testing
[Error: listen EACCES: permission denied /run/user/1000/python-test-discovery-a121c3ca49a094028295.sock
at Server.setupListenHandle [as _listen2] (node:net:1800:21)
at listenInCluster (node:net:1865:12)
at Server.listen (node:net:1964:5)
at /home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:184541
at new Promise (<anonymous>)
at t.createNamedPipeServer (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:184080)
at t.startDiscoveryNamedPipe (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:804427)
at t.UnittestTestDiscoveryAdapter.discoverTests (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:848795)
at t.WorkspaceTestAdapter.discoverTests (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:863627)
at k.refreshTestDataInternal (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:813783)
at /home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:815482
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async k.resolveChildren (/home/sgomez/.vscode-server/extensions/ms-python.python-2024.6.0/out/client/extension.js:2:815378)] {
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '/run/user/1000/python-test-discovery-a121c3ca49a094028295.sock',
port: -1
}
Extension version: 2024.6.0
VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
- Value of the
python.languageServersetting: Default
User Settings
languageServer: "Pylance"
testing
• unittestEnabled: true
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| Black Formatter | ms-python.black-formatter | 2024.2.0 |
| Cucumber (Gherkin) Full Support | alexkrechik.cucumberautocomplete | 2.15.2 |
| Docker | ms-azuretools.vscode-docker | 1.29.1 |
| EditorConfig for VS Code | EditorConfig.EditorConfig | 0.16.4 |
| Flake8 | ms-python.flake8 | 2023.10.0 |
| Git Prefix | srmeyers.git-prefix | 1.3.2 |
| GitLens — Git supercharged | eamodio.gitlens | 15.0.3 |
| isort | ms-python.isort | 2023.10.1 |
| JavaScript Debugger | ms-vscode.js-debug | 1.89.0 |
| json2ts | GregorBiswanger.json2ts | 0.0.6 |
| Jupyter | ms-toolsai.jupyter | 2024.4.0 |
| Jupyter Cell Tags | ms-toolsai.vscode-jupyter-cell-tags | 0.1.9 |
| Jupyter Notebook Renderers | ms-toolsai.jupyter-renderers | 1.0.17 |
| Jupyter Slide Show | ms-toolsai.vscode-jupyter-slideshow | 0.1.6 |
| Live Preview | ms-vscode.live-server | 0.4.13 |
| Move TS - Move TypeScript files and update relative imports | stringham.move-ts | 1.12.0 |
| Path Intellisense | christian-kohler.path-intellisense | 2.8.5 |
| Prettier - Code formatter | esbenp.prettier-vscode | 10.4.0 |
| Pylance | ms-python.vscode-pylance | 2024.5.1 |
| Python | ms-python.python | 2024.6.0 |
| Python Debugger | ms-python.debugpy | 2024.6.0 |
| Rainbow CSV | mechatroner.rainbow-csv | 3.11.0 |
| Table Visualizer for JavaScript Profiles | ms-vscode.vscode-js-profile-table | 1.0.9 |
| TypeScript Extension Pack | loiane.ts-extension-pack | 0.3.0 |
| TypeScript Importer | pmneo.tsimporter | 2.0.1 |
| XML Tools | DotJoshJohnson.xml | 2.5.1 |
| YAML | redhat.vscode-yaml | 1.14.0 |
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 7 5825U with Radeon Graphics (16 x 1996) |
| 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 |
| Load (avg) | undefined |
| Memory (System) | 15.35GB (1.02GB free) |
| Process Argv | --folder-uri=vscode-remote://wsl+Ubuntu/home/sgomez/kitu-batch-scripts --remote=wsl+Ubuntu --crash-reporter-id ac2a5da8-6b46-4388-bddf-1a5fe64c6b9d |
| Screen Reader | yes |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 5.15.146.1-microsoft-standard-WSL2 |
| CPUs | AMD Ryzen 7 5825U with Radeon Graphics (16 x 1996) |
| Memory (System) | 7.44GB (3.64GB free) |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 5.15.146.1-microsoft-standard-WSL2 |
| CPUs | AMD Ryzen 7 5825U with Radeon Graphics (16 x 1996) |
| Memory (System) | 7.44GB (3.64GB free) |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 5.15.146.1-microsoft-standard-WSL2 |
| CPUs | AMD Ryzen 7 5825U with Radeon Graphics (16 x 1996) |
| Memory (System) | 7.44GB (3.64GB free) |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 5.15.146.1-microsoft-standard-WSL2 |
| CPUs | AMD Ryzen 7 5825U with Radeon Graphics (16 x 1996) |
| Memory (System) | 7.44GB (3.64GB free) |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
tftest:31042121
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
showvideoc:31016891
chatpanelt:31048053
dsvsc021:30996838
0ee40948:31013168
pythoncenvpt:31049070
a69g1124:31046351
pythonprc:31047982
dwnewjupytercf:31046870
26j00206:31048877
Activity
philippsuess commentedon May 21, 2024
I have the same problem with discovering pytests. When I switch to
v2024.4.1the test discovery succeeds.Extension version: 2024.6.0
VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:14:32.757Z)
OS version: Darwin arm64 23.4.0
Python Log Output
System Info
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
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
senarvi commentedon May 21, 2024
This started happening to me after VS Code updated today.
eleanorjboyd commentedon May 21, 2024
Hi! We have not made a change to unittest recently- is everyone seeing this on unittest or with pytest too? Could someone try just running unittest/pytest from the command line and seeing if they see similar permissions issues?
sarahandromeda commentedon May 21, 2024
I only use unittest so I can't speak for pytest. However, I can run unittest from the command line with no issues. I can even run the debugger on unittest files. It is just the test discovery that is failing and leading to not being able to use the testing side panel to run anything.
eleanorjboyd commentedon May 21, 2024
Interesting, it seems that your error
/run/user/1000/python-test-discovery-a121c3ca49a094028295.sockis referencing our use of named pipes for communication. This is the same type of communication that run and debug use- could you check for a a similar name for the pipe in your logs for run? Secondly do you have any settings which might restrict thing? See here as we have just changed to named pipes but we do know a few issues still exist: #23279. Thankssenarvi commentedon May 22, 2024
Today, after I restarted my computer, the Testing tab opened the test configuration dialog. I selected pytest and the configuration file, and the tests appeared. This is what I see in the Python Output tab:
There are some errors about test discovery being already in progress, and finally the permission denied error. Anyway, I can attempt running a test, but the test won't run. In Python Output tab I can see the same permission denied error for test execution:
My code is in WSL and I'm using pytest. I can run the tests from WSL command line using
python -m pytest tests.philippsuess commentedon May 22, 2024
I can collect the tests without problems from the command line
python -m pytest --collect-only tests. It's worth noting that I use a custom venv as you can see from the logs.eleanorjboyd commentedon May 22, 2024
Karthik Nadig (@karthiknadig) any thoughts here on what could be causing people to suddenly have permissions issues?
karthiknadig commentedon May 22, 2024
Eleanor Boyd (@eleanorjboyd) This is the issue with using Unix Domian Socket for communication:
We are working on a fix for this to use
fifopipes, than UDS pipes. For work around, see if you can allow Unix domain sockets temporarily until we get the fix out. Or, another option is to pin the extension to the older one where this works.sarahandromeda commentedon May 22, 2024
Sorry for the delay on this.
Do you mean in the output tab when running the tests with the debugger? (SEE BELOW)
When running the debugger on a unittest file, this is what gets logged to
Output: PythonAnd this it what appears in
Output: Python Debugger:Neither seem to reference the same pipe.
I don't believe so, I have not updated any settings recently. However I am using WSL on a Windows machine, but again, I have not changed any settings in my WSL or on Windows (other than system updates).
9 remaining items
peter-crist commentedon Jul 26, 2024
Test collection when configuring

pytestworks fine. But theTESTINGextension still shows discovery error...Version: 1.91.1 (Universal)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:07:54.982Z (2 wks ago)
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.1.0
pytest 8.3.2
pytest-xdist 3.5.0
danbartl commentedon Aug 13, 2024
Does there currently exist any workaround for this topic? It is completely blocking me from using vscode python extension above 2024.4.1, since testing is integral to my work --- and I assume many others as well?
mchccc commentedon Aug 13, 2024
I find myself in this thread again because I forgot to uncheck autoupdate :)
Still happening :/
Thanks for pointing out the version that works!
madig commentedon Aug 13, 2024
Daniel Bartling (@danbartl) #23785
debemdeboas commentedon Sep 3, 2024
Newest version (2024.12.3) still has this issue. The workaround in #23785 works.
eleanorjboyd commentedon Sep 3, 2024
Hi! The testing window should update but if you have multiple extensions contributing to the testing pane (in your example it seems C# is) this might cause it to show up incorrectly. Please file an issue and I can investigate this further to make sure multiple testing extensions work correctly together!
Secondly can you try reloading your window? Then checking your settings.json to make sure the right is enabled for the pytest vs unittest? If that still isn't working send me over the full logs and your settings and I can take a look. Thanks
kelj0 commentedon Oct 31, 2024
I was struggling to fix this for a long time (#23785 didn't work for me), and I finally managed to do a hacky fix for it:
basically you need to create a directory named
1000under/run/user/and set your user as an owner of that directory, this will enable vscode to create a socket and you wont get permission denied.Hope this fixed problems for you
avolok commentedon Nov 27, 2024
Thanks a lot kelj0, this workaround fixes the issue in WSL.
We used a simplified version:
madig commentedon Aug 14, 2025
I automated #23447 (comment) and #23447 (comment) using systemd inside WSL2 with this service:
eleanorjboyd commentedon Sep 23, 2026
🤖 Thanks for the report and detailed logs. The Unix-domain-socket communication causing these permission failures was replaced with FIFO-based communication for Linux and macOS in d1d125a via #24343, and the change shipped in 2024.22.0. Current releases no longer use the failing UDS path for test discovery, so this can be closed as completed. The fix shipped in v2024.22.0.