Skip to content

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

Closed

Description

@luabud

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 (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)

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    triage-neededNeeds assignment to the proper sub-team
    regressionBug didn't exist in a previous release
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Mar 20, 2021
  2. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Mar 20, 2021
  3. added
    needs spikeLabel for issues that need investigation before they can be worked on.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Mar 20, 2021
  4. potens1 commented on Mar 23, 2021

    @potens1

    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
    

  5. alanwilter commented on Mar 31, 2021

    @alanwilter

    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",
                }
            }
  6. niccolomineo commented on Apr 2, 2021

    @niccolomineo

    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

  7. mew1033 commented on Apr 2, 2021

    @mew1033

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

  8. copernico commented on Apr 7, 2021

    @copernico

    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
    
  9. catkins-miso commented on Apr 20, 2021

    @catkins-miso

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

  10. alanwilter commented on Apr 22, 2021

    @alanwilter

    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
    
  11. niccolomineo commented on Apr 22, 2021

    @niccolomineo

    Not here, I still have that error.

  12. Maverickzero commented on May 11, 2021

    @Maverickzero

    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.

  13. aaraney commented on May 12, 2021

    @aaraney

    Yuri A. Martinez Falcão (@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
    
  14. The-Compiler commented on Jun 1, 2021

    @The-Compiler

    I'm on 1.56.2 and also saw "Error: Error: unsupported status (Discovering)" today - even when normally running a single test, without debugging.

  15. Anatoly-Makarevich commented on Jun 30, 2021

    @Anatoly-Makarevich

    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.

  16. brunakov commented on Jul 18, 2021

    @brunakov

    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

  17. karthiknadig commented on Jul 29, 2021

    @karthiknadig
    Member

    This should be addressed by #16769

  18. locked as resolved and limited conversation to collaborators on Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityneeds spikeLabel for issues that need investigation before they can be worked on.regressionBug didn't exist in a previous releaseverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions