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

pytest auto-discovery can hang in some cases blocking other tasks #24604

Closed
lskellerm opened this issue Dec 13, 2024 · 3 comments
Closed

pytest auto-discovery can hang in some cases blocking other tasks #24604

lskellerm opened this issue Dec 13, 2024 · 3 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@lskellerm
Copy link

lskellerm commented Dec 13, 2024

Type: Bug

Behavior

  1. Code changes to any file will set the "progress indicator" on the "Source Control" viewlet indefintely.
  2. Any newly changed files will not appear under the changes dropdown.
  3. This is causing other extensions to stop functioning properly as well (Copilot, Gitlens, Pull Request, Pulumi, AWS toolkit).

Expected vs. Actual Behavior

Expected -

Changes to files should very quickly show the progress indicator in the SCM extension viewlet and then resolve with the number of files where changes are detected.

Actual -

Change and staged files do not update correctly and source control indefinitely fails to display the number of files where changes are detected, instead showing a hanging "progress loader".

Steps to Reproduce

  1. Open python file, make relevant code changes (it will work intermittently after vscode desktop starts up).
  2. After what I observed is 3-4 saves to a changed file, the source control viewlet in the extension displays the previously described behavior.
  3. Reloading Window will temporarily fix the issue, but then occurs after above mentiond steps, only to persist until another "Reload Window" operation.

Observed Workaround

After running an Extension Bisect, it was indicated that the ms-python.python extension was producing the previously outlined issues (note that this was the only extension disabled at the conclusion of the extension bisect)

Reverting to version 2024.20.0 seems to have made the bug go away and I was not able to reproduce the issue with this version enabled.

Diagnostic Data

2024-12-13 21:35:06.185 [info] > /usr/local/bin/python -m pytest -p vscode_pytest --collect-only --rootdir=.
2024-12-13 21:35:06.185 [info] cwd: .
2024-12-13 21:35:06.193 [error] /usr/local/bin/python: No module named pytest

2024-12-13 21:35:06.194 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /workspaces/pulumi.
2024-12-13 21:35:06.195 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /workspaces/pulumi. Creating and sending error discovery payload
2024-12-13 21:35:06.195 [error] pytest test discovery error for workspace:  /workspaces/pulumi 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /workspaces/pulumi
2024-12-13 21:35:10.780 [info] Discover tests for workspace name: pulumi - uri: /workspaces/pulumi/compute/instances/connectableInstance.py
2024-12-13 21:35:10.780 [info] Running discovery for pytest using the new test adapter.
2024-12-13 21:35:31.724 [info] Discover tests for workspace name: pulumi - uri: /workspaces/pulumi/compute/instances/connectableInstance.py
2024-12-13 21:35:31.724 [info] Running discovery for pytest using the new test adapter.
2024-12-13 21:35:31.725 [error] Test discovery already in progress, not starting a new one.

Extension version: 2024.22.0
VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Linux x64 6.11.11-200.fc40.x86_64
Modes:
Remote OS version: Linux x64 6.11.11-200.fc40.x86_64

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.7
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

testing
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
AWS boto3 Boto3typed.boto3-ide 0.6.0
AWS Toolkit amazonwebservices.aws-toolkit-vscode 3.39.0
ESLint dbaeumer.vscode-eslint 3.0.10
Even Better TOML tamasfe.even-better-toml 0.19.2
GitHub Copilot GitHub.copilot 1.251.0
GitHub Copilot Chat GitHub.copilot-chat 0.23.1
GitHub Pull Requests GitHub.vscode-pull-request-github 0.102.0
GitLens — Git supercharged eamodio.gitlens 16.0.5
JavaScript Debugger ms-vscode.js-debug 1.96.0
Prettier - Code formatter esbenp.prettier-vscode 11.0.0
Pulumi pulumi.pulumi-vscode-tools 0.2.2
Pulumi YAML pulumi.pulumi-lsp-client 0.2.3
Pylance ms-python.vscode-pylance 2024.12.1
Python ms-python.python 2024.22.0
Python Debugger ms-python.debugpy 2024.14.0
Ruff charliermarsh.ruff 2024.56.0
shell-format foxundermoon.shell-format 7.2.5
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs AMD Ryzen 5 7600X 6-Core Processor (12 x 5129)
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 93.42GB (70.77GB free)
Process Argv --crash-reporter-id 7c353e5b-56eb-41ee-8832-9589fef11963
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE wayland
Item Value
Remote Dev Container: Pulumi IaC Learning Dev Container
OS Linux x64 6.11.11-200.fc40.x86_64
CPUs AMD Ryzen 5 7600X 6-Core Processor (12 x 4347)
Memory (System) 93.42GB (70.77GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

Image
Image
Image

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 13, 2024
@lskellerm lskellerm changed the title v2024.22.0 - SCM- Source Control extension Hangs Indefinitely After Code Changes 2024.22.0 : SCM- Source Control extension Hangs Indefinitely After Code Changes Dec 13, 2024
@ashertechca
Copy link

ashertechca commented Dec 14, 2024

I was having this issue for the whole day today and finally figured out that the issue is actually related to the test discoveries not SCM. Wish I had came across this earlier.

Couple of things helped in my case without having to downgrade the extension version.

  • I had "python.testing.pytestEnabled": true so I ensured I have pytest package installed
  • Also added the setting, "python.testing.autoTestDiscoverOnSaveEnabled": false

@karthiknadig karthiknadig changed the title 2024.22.0 : SCM- Source Control extension Hangs Indefinitely After Code Changes pytest auto-discovery can hang in some cases blocking other tasks Dec 14, 2024
@shicaiv
Copy link

shicaiv commented Dec 16, 2024

We have same issue with latest python extension I think 2024.22.0, we went back to 2024.20.0 and everything is fine now. We got this issue when we wanted to open test explorer and after that, everything was stuck...

@eleanorjboyd
Copy link
Member

should be fixed by #24611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants