Repository navigation
Debugging tests is returning errors due to "unsupported status" #15736
Copy link
Copy link
Closed
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityIssue identified as high-priorityneeds spikeLabel for issues that need investigation before they can be worked on.Label for issues that need investigation before they can be worked on.regressionBug didn't exist in a previous releaseBug didn't exist in a previous releaseverifiedVerification succeededVerification succeeded
Milestone
Description
Environment data
- VS Code version: 1.54.3
- Extension version (available under the Extensions sidebar): v2021.4.668904848-dev
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.6
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
- Relevant/affected Python packages and their versions: pytest 6.2.2
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Actual behaviour
Debugging tests shows an error notification even though the test passes:

Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Clone this project: https://github.com/luabud/pvscc-logo
- Create a virtual environment and install the dependencies
- Run
Python: Configure Tests, selectpytestand then.for root directory. - Open tests.py and change line 13 to
strinstead ofio.BytesIO - Run the test and see that it passes
- Now click to debug this test
- Watch the error notification pop up even though the debugger session started properly and everything.
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonJoinMailingListVar3'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonDiscoveryModule'
User belongs to experiment group 'pythonTensorboardExperimentcf'
User belongs to experiment group 'DeprecatePythonPath - experiment'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'CollectLSRequestTiming - control'
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Python interpreter path: .\env\Scripts\python.exe
Starting Jedi language server.
> c:\Users\luabud\Apps\pvscc-logo\env\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir c:\Users\luabud\Apps\pvscc-logo -s --cache-clear .
cwd: c:\Users\luabud\Apps\pvscc-logo
> c:\Users\luabud\Apps\pvscc-logo\env\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\pyvsc-run-isolated.py pytest --override-ini junit_family=xunit1 --rootdir c:\Users\luabud\Apps\pvscc-logo --junit-xml=C:\Users\luabud\AppData\Local\Temp\tmp-34824nVG8ptp2l1BN.xml .
cwd: c:\Users\luabud\Apps\pvscc-logo
Output for Python Test Log in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
python c:\Users\luabud\.vscode\extensions\ms-python.python-2021.4.668904848-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir c:\Users\luabud\Apps\pvscc-logo -s --cache-clear .
============================= test session starts =============================
platform win32 -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: c:\Users\luabud\Apps\pvscc-logo, configfile: pytest.ini
collected 1 item
tests.py . [100%]
- generated xml file: C:\Users\luabud\AppData\Local\Temp\tmp-34824nVG8ptp2l1BN.xml -
============================== 1 passed in 6.66s ==============================
Error: Error: unsupported status (Running)
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 bugimportantIssue identified as high-priorityIssue identified as high-priorityneeds spikeLabel for issues that need investigation before they can be worked on.Label for issues that need investigation before they can be worked on.regressionBug didn't exist in a previous releaseBug didn't exist in a previous releaseverifiedVerification succeededVerification succeeded
Activity
potens1 commentedon Mar 23, 2021
exact same error on linux, fyi.
Extension host log
alanwilter commentedon Mar 31, 2021
Exactly same problem on macOS Big Sur. And I use Pylance and I am NOT in any experiment group. I've seen this problem in different projects and also on VSCode remote (Linux).
If I use the bug icon on Test Explorer view, only error "
There was an error in running the tests. Source: Python (Extension)" is shown.If I use cmd+shift+P (Command Palette) -> Python: Debug Test Method... I got:
and
From my
launch.json:{ "name": "PyTest Debug", "type": "python", "request": "test", "justMyCode": true, "console": "integratedTerminal", "env": { "PYTEST_ADDOPTS": "--no-cov", "APP_ENV": "prod", } }niccolomineo commentedon Apr 2, 2021
VS Code version: 1.55
Extension version (available under the Extensions sidebar): v2021.3.680753044
Pylance version: 2021.3.4
OS and version: Mac Os Big Sur / Apple M1
Python version (& distribution if applicable, e.g. Anaconda): Python 3.9.2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A (I am using "VSCode - Containers")
Relevant/affected Python packages and their versions: pytest 6.2.2
mew1033 commentedon Apr 2, 2021
Just started hitting this error as well. Debugging tests is still working as expected, but the error is showing up.
copernico commentedon Apr 7, 2021
Exact same issue here:
catkins-miso commentedon Apr 20, 2021
The python extension auto-updated in my VS Code devcontainer. The problem seems to have been resolved by this version: v2021.4.765268190
alanwilter commentedon Apr 22, 2021
I can confirm I don't see any issues anymore with:
niccolomineo commentedon Apr 22, 2021
Not here, I still have that error.
Maverickzero commentedon May 11, 2021
I'm running version 1.56.0 and I'm getting this error every time I try to run a single test. When I try to "run all tests" it does work. Pytest version is 6.2.2.
aaraney commentedon May 12, 2021
Yuri A. Martinez Falcão (@Maverickzero), I can confirm the same behavior on 1.56.1.
The-Compiler commentedon Jun 1, 2021
I'm on 1.56.2 and also saw "Error: Error: unsupported status (Discovering)" today - even when normally running a single test, without debugging.
Anatoly-Makarevich commentedon Jun 30, 2021
I got this issue today, my tests passed (seen in output), but the last line of the output was
Error: Error: unsupported status (Idle)FYI, just restarting VSCode seemed to fix this. Probably something with an underlying process getting stuck.
brunakov commentedon Jul 18, 2021
When I change a test and run it without re-Discover tests I get :
Error: Error: unsupported status (Running)VSCode information:
Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.8.0-59-generic snap
karthiknadig commentedon Jul 29, 2021
This should be addressed by #16769