Repository navigation
vscode_pytest with mpi deadlock #25663
Description
Type: Bug
I am trying to use the package https://github.com/dlr-sp/pytest-isolate-mpi. I have installed:
- conda install conda-forge::openmpi
- conda install conda-forge::mpi4py
- pip install pytest-isolate-mpi
This is the code I am playing with:
import pytest
@pytest.mark.mpi(ranks=1)
def test_with_mpi(mpi_ranks) -> None:
assert True
If I run the test from the vscode gui buttons (pytest is called with -p vscode_pytest) the test never finish (like if there is a deadlock in mpi). If instead I run from terminal, or if in conftest.py or in settings.json I disable vscode_pytest (e.g. with -p no:vscode_pytest), the test runs and is ok, but the markers on the testing panel are no more updated (i.e. the test is shown as failed).
This is what i get when I disable vscode_pytest:

So this behaviour seems to be related to the interaction between vscode_pytest and mpi4py.
If it is not a bug from vscode side, feel free to close the issue.
VS Code version: Code 1.101.2 (2901c5ac6db8a986a5666c3af51ff804d05af0d4, 2025-06-24T20:27:15.391Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
System Info
| Item | Value |
|---|---|
| CPUs | 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 3302) |
| 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) | 15.79GB (2.61GB free) |
| Process Argv | --folder-uri=vscode-remote://wsl+Ubuntu/home/mattia/pytwinfabrica --remote=wsl+Ubuntu --crash-reporter-id e4b4f9bf-03bd-4f43-8f88-fcac878f7f83 |
| Screen Reader | no |
| VM | 50% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu |
| OS | Linux x64 6.6.87.2-microsoft-standard-WSL2 |
| CPUs | 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 0) |
| Memory (System) | 13.33GB (9.90GB free) |
| VM | 0% |
Extensions (22)
| Extension | Author (truncated) | Version |
|---|---|---|
| jupyter-keymap | ms- | 1.1.2 |
| remote-containers | ms- | 0.417.0 |
| remote-ssh | ms- | 0.120.0 |
| remote-ssh-edit | ms- | 0.87.0 |
| remote-wsl | ms- | 0.99.0 |
| vscode-remote-extensionpack | ms- | 0.26.0 |
| remote-explorer | ms- | 0.5.0 |
| remote-server | ms- | 1.5.2 |
| ruff | cha | 2025.24.0 |
| gitlens | eam | 17.3.0 |
| debugpy | ms- | 2025.8.0 |
| mypy-type-checker | ms- | 2025.2.0 |
| python | ms- | 2025.8.1 |
| vscode-pylance | ms- | 2025.6.2 |
| jupyter | ms- | 2025.6.0 |
| jupyter-keymap | ms- | 1.1.2 |
| jupyter-renderers | ms- | 1.3.0 |
| vscode-jupyter-cell-tags | ms- | 0.1.9 |
| vscode-jupyter-slideshow | ms- | 0.1.6 |
| live-server | ms- | 0.4.15 |
| autodocstring | njp | 0.6.1 |
| vscode-coverage-gutters | rya | 2.13.0 |
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
cppperfnew:31000557
dwnewjupytercf:31046870
nativeloc1:31344060
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
4gafe986:31271826
c7cif404:31314491
pythonpulldiag:31343502
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixt:31329274
9d2cg352:31339597
jhi8h917:31341130
d7aab740:31338110
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31335815
mytest:31335657
4f60g487:31327383
nes-diff-11:31337487
testaa123cf:31335227
onetestforazureexp:31335613
63221493:31336333
yijiwantestdri0626-c:31336931
4gdec884:31342391
Activity
mattfil commentedon Jul 11, 2025
In debug mode, I was able to get the error traceback, which indeed is related to mpi4py not finding vscode_pytest plugin.
eleanorjboyd commentedon Dec 9, 2025
after you try and run the tests can you include the logs from the python extension output log
eleanorjboyd commentedon Dec 17, 2025
I think this will be a feature request to support it with mpi... going to mark as such for now
github-actions commentedon Dec 17, 2025
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.