Repository navigation
Long startup time when running a test from the suite #25827
Copy link
Copy link
Open
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.The issue needs to be confirmed through a maintainer reproducing the bug.
Description
Type: Bug
After last updates, the python test suite becomes very slow. To start running a test it takes about 1/2 minutes. The same happens in debug mode.
If i run the test from terminal, I do not experience this issue.
Extension version: 2026.2.0
VS Code version: Code 1.109.5 (072586267e68ece9a47aa43f8c108e0dcbf44622, 2026-02-19T19:43:32.382Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
- Python version (& distribution if applicable, e.g. Anaconda): 3.12.3.final.0
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
- Value of the
python.languageServersetting: Default
User Settings
languageServer: "Pylance"
testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| autodocstring | njp | 0.6.1 |
| chatgpt | ope | 0.4.79 |
| copilot-chat | Git | 0.37.9 |
| debugpy | ms- | 2025.18.0 |
| gitlens | eam | 17.10.2 |
| js-debug | ms- | 1.105.0 |
| jupyter | ms- | 2025.9.1 |
| jupyter-renderers | ms- | 1.3.0 |
| mypy-type-checker | ms- | 2025.3.13521012 |
| python | ms- | 2026.0.0 |
| ruff | cha | 2026.36.0 |
| vscode-js-profile-table | ms- | 1.0.10 |
| vscode-jupyter-cell-tags | ms- | 0.1.9 |
| vscode-jupyter-slideshow | ms- | 0.1.6 |
| vscode-pylance | ms- | 2026.1.100 |
| vscode-python-envs | ms- | 1.16.0 |
System Info
| Item | Value |
|---|---|
| CPUs | 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803) |
| GPU Status | 2d_canvas: enabled GPU0: VENDOR= 0x8086, DEVICE=0x9a49 [Intel(R) Iris(R) Xe Graphics], DRIVER_VENDOR=Intel, DRIVER_VERSION=30.0.101.1960 ACTIVE GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.7309 Machine model name: Machine model version: 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 trees_in_viz: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 15.79GB (4.47GB free) |
| Process Argv | --crash-reporter-id 195d8d56-d821-42a5-9371-14c941f06a95 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 6.6.87.2-microsoft-standard-WSL2 |
| CPUs | 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 0) |
| Memory (System) | 15.06GB (13.14GB free) |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsactivate1:31464700
cloudbuttont:31379625
aihoversummaries_t:31469308
3efgi100_wstrepl:31403338
use-responses-api:31390855
je187915:31401257
ec5jj548:31422691
cp_cls_c_966_ss:31454199
4je02754:31466945
find_all_ref_in_bg_t:31469306
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-off:31446584
a5gib710:31434435
00h15499_gpt_53_codex:31464543
7a04d226_do_not_restore_last_panel_session:31438103
gpt_5_3_codex_f4456sfsd:31465102
cp_cls_c_1081:31454833
copilot-nes-oct-trt:31432596
ia-use-proxy-models-svc:31452481
a43f0574a:31442826
e9c30283:31461165
nes-fast-additive:31462666
control_6dc23131:31467998
9c05b404_max_request_50:31468594
idci7584:31464702
edit_mode_hidden:31461530
864ei723_large_tool_results_to_disk:31460878
notips:31457203
55364912:31458074
nes-extended-on:31455476
chat:31457767
thinking_effort_h:31469317
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.The issue needs to be confirmed through a maintainer reproducing the bug.
Activity
eleanorjboyd commentedon Mar 3, 2026
Do you have multiple interpreters in one workspace (like separate python projects for different tests)? How many tests are you trying to run and are there any other pytest plugins you are using?
afNewtwen commentedon Mar 4, 2026
No, I have just one interpreter (from pixi) for the test suite. I am trying to run one test, i am not using any other plugins for pytest.
The problem seems more severe when trying to debug even one single test.
afNewtwen commentedon Mar 4, 2026
I think the problem is related to python environment extension with pixi. As I reported also in the repo of python env plugin, trying to install pixi extension solve also this problem of slow test initialization.
harisbal commentedon Jul 28, 2026
I can confirm the root cause for a Pixi-managed environment: the extension resolves test-debug environment variables by shelling out to
pixi shell, which launches an interactive nested shell that never returns control on its own. The extension's own 30s timeout then kills it — and it retries once, so the delay is closer to 60s per debug run.Log evidence (
ms-python.python/Python.log, extension 2026.4.0):This only happens through the Test Explorer's debug flow — regular
launch.jsondebug configs (which don't force a custompythonenv-activation lookup) stay fast (<1s) in the same session, andpixi run pytestfrom a terminal is unaffected since it never goes through this code path.Confirmed in the bundled extension source (
out/client/extension.js) that the Pixi activation command is built as:i.e.
pixi shell, whereas Pixi ships a purpose-built non-interactive equivalent for exactly this use case:Swapping
shell→shell-hook --json(or reusing whatevergetRunPythonArgsalready does withpixi run) in the activation-variable code path should resolve this without the 30s wait. Same underlying issue as #25804 and #25192, just hitting the test-debug path here instead of Jupyter/terminal.Workaround in the meantime: add a
launch.jsonconfig that runs pytest viamodule: "pytest"directly (bypassing Test Explorer's debug entrypoint) — this uses the same fast path as any otherlaunch.jsondebug config.