-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pytest discovery stuck in Output panel #18656
Comments
Hi @mrtolkien, thank you for reaching out. Do you have a sample repo I could use to try and replicate your issue? Thanks! |
This is happening in a private monorepo that has both Jest and Pytest suites configured. The python interpreter is built with poetry and properly gets activated when opening the terminal. Jest and Pytest used to cohabitate peacefully, but now pytests discovery freezes forever with no feedback on logging. I'm not entirely sure how to recreate a similar repo to try and reproduce the problem, especially since there's no feedback from the extension. Is it possible to run a debugger attached to it? |
Still facing this issue, but it's intermittent. Sometimes I'll start VS Code and it'll properly pick up the tests, sometimes it won't. But most of the time it just stays stuck, with the following feedback in
I'm also seeing nothing in the Extensions Log Folder, it's just frozen there forever and impossible to debug. I wish I could give more information honestly, but the exact incriminating command runs perfectly in the terminal already... |
I have installed this extension and it finds and runs my tests properly: It relies on the same settings coming from The repo is very big as it's a monorep containing both Typescrip and Python projects, could that be an issue? |
Hi @mrtolkien, sorry for the delay!
Maybe? |
Even the test discovery command works with the python That's what's weird, everything works from a terminal, but for some reason the extension is stuck forever. Is it trying to index files in huge folders, like |
Same problem here, the command seems to be stuck.
Executing the command via terminal is returns the path to the tests normally. |
Hi @CleitonDeLima, same question as above, what is the output in the terminal? Do you have a sample repo I could use to try and replicate your issue? |
Hi @kimadeline I have this problem in any project, this is the last one I tested. Running
vscode returns:
Config System
A/B experiment info
My enabled extensions
(3 theme extensions excluded) Notes
|
I'm also getting this issue. I'm running Ubuntu 20.04.4 LTS on WSL2. VSCode version details: Version: 1.66.2 (user setup) the in the VSCode the python log hangs during the test discovery as so, > /bin/python3 ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
cwd: . When running the same command in the terminal in VSCode I get the following output, matthew@studio:~/Source/test_vscode$ /bin/python3 ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
[{"rootid": ".", "root": "/mnt/c/Users/matthew/Source/test_vscode", "parents": [{"id": "./tests", "kind": "folder", "name": "tests", "parentid": ".", "relpath": "./tests"}, {"id": "./tests/test_1.py", "kind": "file", "name": "test_1.py", "parentid": "./tests", "relpath": "./tests/test_1.py"}], "tests": [{"id": "./tests/test_1.py::test_fail", "name": "test_fail", "source": "./tests/test_1.py:4", "markers": [], "parentid": "./tests/test_1.py"}]}]
matthew@studio:~/Source/test_vscode$ This problem occurs in a minimal test environment, matthew@studio:~/Source/test_vscode$ tree
.
└── tests
├── __init__.py
└── test_1.py Where import pytest
def test_fail():
assert 0 == 1 I have also attached a tar of the test environment. |
I am also encountering this issue where in the python Output panel pytest doesn't appear to discover any tests, but running the exact same command in the Terminal panel gives the expected output. The below steps to reproduce worked for me with a fresh install using the following system info:
Steps to reproduce:
Hope this helps. |
I have the same problem on OS: Darwin arm64 21.1.0 with VS Code 1.66.2 |
I ran into this issue and another colleague did as well. In our case, we used to see
|
We are working on a I will add this issue to that task for verification when it is done. |
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and I am not longer reproducing the bug! I used the minimal repro from @matthewghgriffiths. If any of you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users |
@eleanorjboyd Great, thank you! With the new, experimental test adapter the test discovery worked quickly! Note that I also had to set I have 2 repos with tests open in my workspace. With the old test adapter, the tests from repo A were loaded without issue but the test discover for repo B was running forever. Strangely, with the new, experimental adapter, the tests from B are discovered quickly, but I get a test discovery error for repo A:
Not sure what to do with this? Running Also, if I try to run tests from repo B, which are now discovered quickly with the new adapter, I get new errors about unclosed sockets, which I did not get before:
Not sure if all of these are related; just posting any info that may be useful. |
My bad: I could resolve my issues with test discovery and running tests, simply by selecting: "Python: Configure Tests" from the command palette. Here I could select where to search for tests. Now test discovery works quickly without the experimental adapter. |
Great! Glad it got resolved! |
Issue Type: Bug
Behaviour
Expected vs. Actual
Running
pytest
in the terminal works. Running the discovery command from VS Code directly works:But in the
OUTPUT/Python
tab the process is stuck and never finds tests.If I forcefully stop it, the logs are:
Interestingly, the log error looks to be 1 month in the past for some reason.
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultUser Settings
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
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
A/B Experiments
The text was updated successfully, but these errors were encountered: