Skip to content

Tests hang if subprocess spawned but not killed #22573

@JamesHutchison

Description

@JamesHutchison

Type: Bug

Behaviour

Expected vs. Actual

Expected:
When all tests complete, the test runner acts like everything is good (legacy behavior).

Actual:
When running tests, even if all tests complete, the test GUI will continue to show a spinner and block running new tests if a test leaves a process running.

Steps to reproduce:

  1. Have a test spawn a subprocess, but don't kill it.
  2. Alternatively, use pytest-hot-reloading, which is the library where I encountered this issue. It has the argument --daemon-start-if-needed which starts the pytest daemon automatically when running a test.

The library has a codespace already configured: https://github.com/JamesHutchison/pytest-hot-reloading

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

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

Extension version: 2023.20.0
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.2.0-1016-azure
Remote OS version: Linux x64 6.2.0-1016-azure

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.89GB (4.65GB free)
Process Argv --crash-reporter-id ae591a24-d374-4309-8087-11db7f271645
Screen Reader no
VM 0%
Item Value
Remote Codespaces: orange giggle
OS Linux x64 6.2.0-1016-azure
CPUs AMD EPYC 7763 64-Core Processor (2 x 3035)
Memory (System) 7.74GB (5.57GB free)
VM 0%
Item Value
Remote Codespaces: fluffy capybara
OS Linux x64 6.2.0-1016-azure
CPUs AMD EPYC 7763 64-Core Processor (2 x 3242)
Memory (System) 7.74GB (3.89GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30899288
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
89544117:30613380
2i9eh265:30646982
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions