Skip to content

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.py

As 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 Testing tab in the side panel
  • In side-bar, message appears Unittest Discovery Error
  • Open Up the Outputs tab to Python
  • 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.languageServer setting: 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions