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

Cannot run unittest in parallel anymore #24829

Open
NicolasM-Forsk opened this issue Feb 19, 2025 · 7 comments
Open

Cannot run unittest in parallel anymore #24829

NicolasM-Forsk opened this issue Feb 19, 2025 · 7 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@NicolasM-Forsk
Copy link

NicolasM-Forsk commented Feb 19, 2025

Type: Bug

A few weeks/months ago, I was able to run unittests in parallel by selecting many of them and clicking on "run".
This doesn't work anymore, tests are run sequencially which takes much more time.
Did you change the internal mechanism?

Extension version: 2025.0.0
VS Code version: Code 1.97.2 (e54c774e0add60467559eb0d1e229c6452cf8447, 2025-02-12T23:20:35.343Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

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


envFile: "<placeholder>"

languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
autopep8 ms- 2024.1.11501016
cmake twx 0.0.17
cmake-tools ms- 1.19.52
cpptools ms- 1.23.6
cpptools-extension-pack ms- 1.3.0
csdevkit ms- 1.16.6
csharp ms- 2.63.32
debugpy ms- 2025.0.1
even-better-toml tam 0.21.2
flake8 ms- 2024.0.0
git-graph mhu 1.30.0
gitlens eam 16.3.0
js-debug ms- 1.97.1
jupyter ms- 2025.1.0
jupyter-renderers ms- 1.1.0
paste-as-string-array sha 1.0.0
python ms- 2025.0.0
spectral sto 1.1.4
typespec-vscode typ 0.65.0
vscode-catch2-test-adapter mat 4.12.2
vscode-docker ms- 1.29.4
vscode-dotnet-runtime ms- 2.2.8
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-language-pack-fr MS- 1.97.2025021209
vscode-openapi 42C 4.31.0
vscode-pylance ms- 2025.2.1
vscode-sort-json ric 1.20.0
vscode-xml red 0.27.2
vscode-yaml red 1.16.0
vscode-yaml-sort Pas 6.6.1
System Info
Item Value
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904)
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) 31.72GB (4.47GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-22.04
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 0)
Memory (System) 11.68GB (3.94GB free)
VM 0%
Item Value
Remote WSL: Ubuntu-22.04
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 0)
Memory (System) 11.68GB (3.94GB free)
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 19, 2025
@lukaskoehrer
Copy link

I have a similar issue since upgrading to 2025.0.0. If i click on "run" for a certain test while some other tests are running they are not added to the current test run and "Test Results" only shows "Finished running tests!". While the first test runs through, the second test does not seem to be started.

When reverting to 2024.22.2 I can run tests in parallel again.

I also could not figure out if this change is intended or not, or how to restore the old behavior on the new version.

@nmoreaud
Copy link

I have a similar issue since upgrading to 2025.0.0. If i click on "run" for a certain test while some other tests are running they are not added to the current test run and "Test Results" only shows "Finished running tests!". While the first test runs through, the second test does not seem to be started.

When reverting to 2024.22.2 I can run tests in parallel again.

I also could not figure out if this change is intended or not, or how to restore the old behavior on the new version.

Yes, same here.

@eleanorjboyd
Copy link
Member

Hi! Intended behavior is being able to run them in parallel. Can you set your log levels to debug and send them here? To do so set developer: set long level in the command prompt and then look in the python output channel

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 19, 2025
@nmoreaud
Copy link

Here is a sample workspace: seq_tests.zip
I reproduce the two behaviors previously mentioned.
Please note that there are both code_workspace and .vscode/launch.json, to ensure that "justMyCode" is taken into account across versions of VSCode (it is often broken after updates for workspaces).

@eleanorjboyd
Copy link
Member

Hi! What if you install pytest-xdist and then add the argument -n auto. This is what supports running tests in parallel, that specific plugin

@lukaskoehrer
Copy link

I am running my tests with pytest and pytest-xdist and the argument -n auto.

While vscode correctly starts up multiple workers and runs the tests in parallel if I click on a group of tests, starting another group or another single test via clicking on it does not work anymore if the run initiated via the first click has not finished yet.

@nmoreaud
Copy link

nmoreaud commented Mar 5, 2025

In previous versions, I didn't need pytest-xdist. In latest version pytest-xdist works fine, except that we have lost in interactivity.
As @lukaskoehrer says, we cannot start tests incrementally, we must wait for one test session to finish before running a new one.

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

No branches or pull requests

4 participants