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

Debugging tests is returning errors due to "unsupported status" #15736

Closed
luabud opened this issue Mar 20, 2021 · 14 comments · Fixed by #16769
Closed

Debugging tests is returning errors due to "unsupported status" #15736

luabud opened this issue Mar 20, 2021 · 14 comments · Fixed by #16769
Labels
area-testing bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority needs spike Label for issues that need investigation before they can be worked on. regression Bug didn't exist in a previous release verified Verification succeeded
Milestone

Comments

@luabud
Copy link
Member

luabud commented Mar 20, 2021

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:
image

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Clone this project: https://github.com/luabud/pvscc-logo
  2. Create a virtual environment and install the dependencies
  3. Run Python: Configure Tests, select pytest and then . for root directory.
  4. Open tests.py and change line 13 to str instead of io.BytesIO
  5. Run the test and see that it passes
  6. Now click to debug this test
  7. Watch the error notification pop up even though the debugger session started properly and everything.

Logs

Output for Python in the Output panel (ViewOutput, 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 (ViewOutput, 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)

@luabud luabud added bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team regression Bug didn't exist in a previous release area-testing and removed triage-needed Needs assignment to the proper sub-team labels Mar 20, 2021
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Mar 20, 2021
@luabud luabud added needs spike Label for issues that need investigation before they can be worked on. and removed triage-needed Needs assignment to the proper sub-team labels Mar 20, 2021
@potens1
Copy link

potens1 commented Mar 23, 2021

exact same error on linux, fyi.

Extension host log

[2021-03-23 11:54:20.249] [exthost] [error] Error: unsupported status (Running)
    at c.getMessagePrefix (/home/nic/.vscode/extensions/ms-python.python-2021.3.658691958/out/client/extension.js:61:570701)
    at a.getDiagnosticMessage (/home/nic/.vscode/extensions/ms-python.python-2021.3.658691958/out/client/extension.js:9:500108)
    at a.createDiagnostics (/home/nic/.vscode/extensions/ms-python.python-2021.3.658691958/out/client/extension.js:9:499698)
    at a.updateDiagnostics (/home/nic/.vscode/extensions/ms-python.python-2021.3.658691958/out/client/extension.js:9:498664)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at a.runTestImpl (/home/nic/.vscode/extensions/ms-python.python-2021.3.658691958/out/client/extension.js:61:651720) python.debugtests
[2021-03-23 11:54:20.249] [exthost] [error] Error: Running the contributed command: 'python.debugtests' failed.
    at S._executeContributedCommand (/home/nic/.local/share/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:103934)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at S._executeContributedCommand (/home/nic/.local/share/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:103766) _vscode_delegate_cmd_kmlscd6b

@luabud luabud added the important Issue identified as high-priority label Mar 23, 2021
@alanwilter
Copy link

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:

Error: Error: unsupported status (Discovering)

and

Command 'Python: Debug Test Method ...' resulted in an error (Running the contributed command: 'python.selectAndDebugTestMethod' failed.)

From my launch.json:

        {
            "name": "PyTest Debug",
            "type": "python",
            "request": "test",
            "justMyCode": true,
            "console": "integratedTerminal",
            "env": {
                "PYTEST_ADDOPTS": "--no-cov",
                "APP_ENV": "prod",
            }
        }

@niccolomineo
Copy link

niccolomineo commented 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

Schermata 2021-04-02 alle 18 29 30

Schermata 2021-04-02 alle 18 29 34

@mew1033
Copy link

mew1033 commented Apr 2, 2021

Just started hitting this error as well. Debugging tests is still working as expected, but the error is showing up.

@copernico
Copy link

copernico commented Apr 7, 2021

Exact same issue here:

uname -a                          
Linux ncel34304220a 4.15.0-140-generic #144-Ubuntu SMP Fri Mar 19 14:12:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

code --version
1.55.0
c185983a683d14c396952dd432459097bc7f757f
x64

python --version                      
Python 3.8.0

pytest --version
pytest 6.2.3

@catkins-miso
Copy link

The python extension auto-updated in my VS Code devcontainer. The problem seems to have been resolved by this version: v2021.4.765268190

@alanwilter
Copy link

I can confirm I don't see any issues anymore with:

Version: 1.55.2
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:36:32.643Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0

@niccolomineo
Copy link

Not here, I still have that error.

@Maverickzero
Copy link

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
Copy link

aaraney commented May 12, 2021

@Maverickzero, I can confirm the same behavior on 1.56.1.

Version: 1.56.1
Commit: e713fe9b05fc24facbec8f34fb1017133858842b
Date: 2021-05-06T10:08:24.325Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 18.7.0

@The-Compiler
Copy link

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
Copy link

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
Copy link

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 karthiknadig added the verified Verification succeeded label Jul 29, 2021
@karthiknadig
Copy link
Member

This should be addressed by #16769

@karthiknadig karthiknadig added this to the August 2021 milestone Aug 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority needs spike Label for issues that need investigation before they can be worked on. regression Bug didn't exist in a previous release verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.