Skip to content

Pytest discovery stuck in Output panel #18656

Closed

Description

Issue Type: Bug

Behaviour

Expected vs. Actual

Running pytest in the terminal works. Running the discovery command from VS Code directly works:

> ~/.cache/pypoetry/virtualenvs/lol-data-rest-api-m4zklELf-py3.10/bin/python ~/.vscode-server/extensions/ms-python.python-2022.2.1924087327/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . --cache-clear --runxfail -s rest_api/tests

[{"rootid": ".", "root": "/home/tolki/development/mobalab/mobalab_backend", "parents": [{"id": "./rest_api", "kind": "folder", "name": "rest_api", "parentid": ".", "relpath": "./rest_api"}, {"id": "./rest_api/tests", "kind": "folder", "name": "tests", "parentid": "./rest_api", "relpath": "./rest_api/tests"}, {"id": "./rest_api/tests/test_games.py", "kind": "file", "name": "test_games.py", "parentid": "./rest_api/tests", "relpath": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_add_note", "kind": "function", "name": "test_add_note", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_delete_riot_game", "kind": "function", "name": "test_delete_riot_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_get_game_champion", "kind": "function", "name": "test_get_game_champion", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_insert_and_delete_game", "kind": "function", "name": "test_insert_and_delete_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_update_game", "kind": "function", "name": "test_update_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_get_game_details.py", "kind": "file", "name": "test_get_game_details.py", "parentid": "./rest_api/tests", "relpath": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_all_kills", "kind": "function", "name": "test_get_all_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_building_kills", "kind": "function", "name": "test_get_game_building_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_epic_monsters_kills", "kind": "function", "name": "test_get_game_epic_monsters_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_gold", "kind": "function", "name": "test_get_game_gold", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_kills", "kind": "function", "name": "test_get_game_kills", "parentid": "./rest_api/tests/test_get_game_details.py"},
(...)

But in the OUTPUT/Python tab the process is stuck and never finds tests.

If I forcefully stop it, the logs are:

[ERROR 2022-2-8 18:31:46.477]: Cancelled discovering pytest tests:
 SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at a.runTestDiscovery (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:82661)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at E.refreshTestData (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:94259)
    at v.refreshTestDataInternal (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:85653)
    at async Promise.all (index 0)
    at v.resolveChildren (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:86988) {
  stdout: ''
}

Interestingly, the log error looks to be 1 month in the past for some reason.

Steps to reproduce:

  1. Launch VS Code
  2. No Python tests :(

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.1
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.2.1924087327
VS Code version: Code 1.65.0 (b5205cc8eb4fbaa726835538cd82372cc0222d43, 2022-03-02T11:12:08.962Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 7 5800X 8-Core Processor (16 x 3793)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.90GB (12.93GB free)
Process Argv --crash-reporter-id 0b342376-bcbb-4c08-9c59-05e04abdb7b7
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs AMD Ryzen 7 5800X 8-Core Processor (16 x 3792)
Memory (System) 15.58GB (8.76GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vsclayoutctrt:30448491
dsvsc009:30440023
pythonvspyt640:30442238
vsbas813:30436447
vscscmwlcmt:30438805
vscgsvidc:30447482
helix:30440343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked onverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions