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

Python test shows spinning icon #7898

Closed
astrozot opened this issue Oct 10, 2019 · 21 comments
Closed

Python test shows spinning icon #7898

astrozot opened this issue Oct 10, 2019 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@astrozot
Copy link

Environment data

  • VS Code version: 1.39.0
  • Extension version (available under the Extensions sidebar): 2019.10.41019
  • OS and version: Mac OS 10.14.6
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.1 (Anaconda 4.6.11)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: All
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): No

Expected behaviour

When running a test, I expect to see a spinning icon disappear after the test is completed, to show a green or red icon depending on the result of the text.

Actual behaviour

The spinning icon keeps spinning.

Steps to reproduce:

  1. Within a workspace with python test units, run any test
  2. The spinning icon will start to appear (and in my case will not disappear)
  3. At the same time, the Console shows the error (see also below)
[renderer1] [error] TreeError [CustomView] Data tree node not found: [object Object]: Error: TreeError [CustomView] Data tree node not found: [object Object]

Screen Shot 2019-10-10 at 15 16 02

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 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - control'
Starting Jedi Python language engine.
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> /Applications/anaconda3/bin/python -c "import sys;print(sys.executable)"
> conda info --json
> conda info --json
> conda info --json
> conda env list
> conda env list
> /Applications/anaconda3/bin/python -c "import sys;print(sys.prefix)"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -c "import sys;print(sys.prefix)"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -c "import sys;print(sys.executable)"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -c "import sys;print(sys.executable)"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -m site --user-site
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -m site --user-site
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python completion.py
cwd: ~/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles
> /Applications/anaconda3/bin/python completion.py
cwd: ~/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles
> /Applications/anaconda3/bin/python ~/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear xnicer
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -m mypy --ignore-missing-imports --follow-imports=silent --show-column-numbers ~/src/python/xnicer/xnicer/xdeconv/test_em_step.py
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python -m mypy --ignore-missing-imports --follow-imports=silent --show-column-numbers ~/src/python/xnicer/xnicer/xdeconv/test_em_step.py
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/src/python/xnicer/xnicer/xdeconv/test_em_step.py
cwd: ~/src/python/xnicer
##########Linting Output - mypy##########
##########Linting Output - pylint##########
************* Module xnicer.xdeconv.test_em_step
4,0,error,no-name-in-module:No name 'log_likelihoods' in module 'xnicer.xdeconv.em_step'
4,0,error,no-name-in-module:No name 'py_e_single_step' in module 'xnicer.xdeconv.em_step'
4,0,error,no-name-in-module:No name 'em_step' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'FIX_NONE' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'FIX_AMP' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'FIX_MEAN' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'FIX_COVAR' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'FIX_ALL' in module 'xnicer.xdeconv.em_step'
5,0,error,no-name-in-module:No name 'em_step' in module 'xnicer.xdeconv.em_step'
88,4,warning,unused-variable:Unused variable 'r'

------------------------------------------------------------------
Your code has been rated at 8.88/10 (previous run: 8.88/10, +0.00)

> /Applications/anaconda3/bin/python ~/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear xnicer
cwd: ~/src/python/xnicer
> /Applications/anaconda3/bin/python ~/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/symbolProvider.py ~/src/python/xnicer/xnicer/xdeconv/test_em_step.py
> conda info --json
> /Applications/anaconda3/bin/python -m pytest --junitxml=/var/folders/_r/flgz8mc97j16zsg6px5s40d00000gn/T/tmp-34883iwBitGeP6ZP.xml ./xnicer/xdeconv/test_em_step.py::test_pyxc_1d
cwd: ~/src/python/xnicer

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

[2019-10-10 14:25:29.550] [renderer1] [error] TreeError [CustomView] Data tree node not found: [object Object]: Error: TreeError [CustomView] Data tree node not found: [object Object]
    at Y.getDataNode (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1045:675)
    at Y.rerender (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1043:295)
    at t.visible.e.map.e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4974:446)
    at Array.map (<anonymous>)
    at U.doRefresh (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4974:437)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2019-10-10 14:25:32.066] [renderer1] [error] TreeError [CustomView] Data tree node not found: [object Object]: Error: TreeError [CustomView] Data tree node not found: [object Object]
    at Y.getDataNode (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1045:675)
    at Y.rerender (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1043:295)
    at t.visible.e.map.e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4974:446)
    at Array.map (<anonymous>)
    at U.doRefresh (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4974:437)
    at process._tickCallback (internal/process/next_tick.js:68:7)
@astrozot astrozot added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Oct 10, 2019
@astrozot
Copy link
Author

Quick update: the same bug is present in the insider (daily) version of the Python VSCode extension, used within the insider version of VSCode.

@astrozot
Copy link
Author

Not sure anymore what is happening. Downgrading to the previous version of the Python extension does not solve the issue (which, however, started to appear after the latest update). Downgrading VSCode to the August 2019 version does solve the issue.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Oct 10, 2019
@kimadeline kimadeline added the P0 label Oct 10, 2019
@kimadeline kimadeline added this to the 2019 October Sprint 2 milestone Oct 10, 2019
@ericsnowcurrently
Copy link
Member

@astrozot, thanks for letting us know about this. At first glance it looks like an incompatibility with changes in the recent release of VS Code. We'll definitely look into that.

In the meantime, when you downgraded VS Code to the August release, did you still see the problem with the latest release of the Python extension? What about with the insiders build?

@ericsnowcurrently
Copy link
Member

FTR, the release notes for VS Code 1.39 mention a number of changes related to tree views. I'm guessing that's where we should focus attention.

@astrozot
Copy link
Author

@ericsnowcurrently Thank you for your quick reaction! The August release of VS Code does not show any issue: I am currently using it together with the latest release of the Python extension and everything seems OK.

@JosephTLyons
Copy link

JosephTLyons commented Oct 13, 2019

I'm having the same issue as well. For me, it only ever happens when choosing to run a single test, either via the test panel on the left or with the inline buttons in the editor. If I choose to run a batch of tests, the issue doesn't occur.

@askvortsov1
Copy link

I'm having this as well. The test gets stuck on loading, and doesn't show the debug and run buttons that are typically present to the site of the test. Furthermore, as there's no cancel button for individual tests, there's no way to stop it other than restarting VSCode.

I noticed that this only happens when I try to debug / run an individual test, and that test fails. It doesn't happen when all the tests are run together.

@karthiknadig
Copy link
Member

Related issue on microsoft/vscode#82290

@karthiknadig
Copy link
Member

This looks like a regression in VSCode Tree View. Filed an issue on microsoft/vscode#82629

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Oct 15, 2019
@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Oct 15, 2019
@jeanlucmongrain
Copy link

confirmed with 1.39.2

@YoDaMa
Copy link

YoDaMa commented Oct 18, 2019

Just adding that I also see this happening in my Python environment on VSCode. Run a single test and it hangs indefinitely.

Python Extension Version: 2019.10.41019

@natemwilson
Copy link

natemwilson commented Oct 18, 2019

Chiming that not only does this happen, but then I can't run any more tests from the tree view until I reload vscode.

Python Extension Version: 2019.10.41019
VS Code Version: 1.39.2

@roger-mahler
Copy link

Ditto. Happens only when I run or debug a single test. If I stick to "Run All Tests" it works fine.

Python Extension Version: 2019.10.41019
VS Code Version: 1.39.2
pytest: 5.0.1

@georgesmith2017
Copy link

georgesmith2017 commented Oct 20, 2019

I dug a bit deeper. Tested a class with three tests:

  1. Ran all tests from the very top - the Run All Tests button immediately to the right of the TEST PYTHON caption - all 3 tests were highlighted green as expected
  2. Ran all tests from the python module level, e.g. test_my_file.py - clicked the green arrow Run button - folder, module, test class, and first test nodes were correctly highlighted in green. The remaining two test nodes remained unchanged, with a question mark icon next to them, as if they were never run. Verified the question marked tests were actually run in the Output console tab.
  3. Running all tests from within the class works as expected - all nodes are marked green
  4. Running a single test from within the class produces the already reported spinning icon problem and can be remedied only by restarting VS Code.

Guys, thanks in advance for working on a fix :)

@karthiknadig
Copy link
Member

This is an upstream issue and has to be addressed in VS Code. currently no action on the extension side.

@YoDaMa
Copy link

YoDaMa commented Oct 25, 2019

Hey @karthiknadig, what's the ETA on the fix on the part of VS Code? I'm inclined to want this to be open, since it is a bug. It should stay open till VS Code fixes it. Currently VSCode is unsuable for debugging pytests, and I've switch to PyCharm for debugging in the interim.

@luabud
Copy link
Member

luabud commented Oct 25, 2019

Hey @YoDaMa, I understand your point of view. The thing is that we have over 1K open issues, so it gets really hard to keep track of what needs to be done and prioritized. That's why we've been closing issues in this repo that are being or will be addressed upstream, just to try to get a manageable backlog of open issues that we can fix in the Python extension. However, I'd like to highlight that this issue is not breaking debugging tests, I believe you're experiencing a different issue.

@natemwilson
Copy link

@luabud or @karthiknadig can you point us to the relevant issue in the vscode repo?

@karthiknadig
Copy link
Member

@natemwilson This one microsoft/vscode#82629

@rvanlaar
Copy link

The upstream issue seems part of the 2019 October sprint 3.
In the mean time rolling back to the august release and setting update to 'none' in the settings will let you continue working. https://code.visualstudio.com/updates/v1_38

@rvanlaar
Copy link

FYI for when VSCode is installed as a package, especially for linux users.

Setting update to 'None' is not enough.
The package manager will try to update VScode.
Here's how to disable the updates for just one package on ubuntu and debian based distros:
https://askubuntu.com/questions/18654/how-to-prevent-updating-of-a-specific-package

@lock lock bot locked as resolved and limited conversation to collaborators Nov 3, 2019
@ericsnowcurrently ericsnowcurrently removed their assignment Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests