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

debug test is hanging #3869

Closed
jruizaranguren opened this issue Jan 4, 2019 · 19 comments
Closed

debug test is hanging #3869

jruizaranguren opened this issue Jan 4, 2019 · 19 comments
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug linux
Milestone

Comments

@jruizaranguren
Copy link

Environment data

  • VS Code version: 1.30.1
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): anaconda Python 3.6.7 64 bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: pytest 3.9.3

Expected behaviour

After setting a breakpoint in single test, when clicking "Debug Test" above the test, it should stop at the breakpoint.

Actual behaviour

VS Code launches the debugging tool bar and it hangs there.
Run Test works properly.

Steps to reproduce:

Simply try to debug test in the described environment with pytest.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Nothing is shown.

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)

Nothing is written when clicking debug in developer tools console.
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 4, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 7, 2019
@brettcannon
Copy link
Member

I can't reproduce:
image

If you can replicate with a simpler test then let us know and we can re-open this issue. Otherwise it sounds like the connection itself is timing out which often happens if the setup time of your test takes a long time and the debugger can't attach in time (which has been known to happen under conda). If you want you can try to provide more info about how it is hanging and we can see if there's something obvious.

@ghost ghost removed the triage label Jan 8, 2019
@jruizaranguren
Copy link
Author

Is there any way to increase the timeout so I can confirm the issue?

@jruizaranguren
Copy link
Author

I have reproduced the issue and upload the required files to this repo.

Steps to reproduce

> create conda environment from file: conda env create -f issue3869_env.yml
> source activate issue3869
> code .

Then, set a breakpoint in test_debugging.py::test_does_not_set_breakpoints.

Additional info

We reproduce the issue in vscode 1.30.1, but it works in versions 1.21.1 and 1.25.1.

@brettcannon
Copy link
Member

@jruizaranguren thanks for the reproducer. We will give it a try and get back to you.

@brettcannon brettcannon added triage-needed Needs assignment to the proper sub-team linux and removed triage labels Jan 10, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 10, 2019
@brettcannon brettcannon removed their assignment Jan 10, 2019
@brettcannon brettcannon added the triage-needed Needs assignment to the proper sub-team label Jan 10, 2019
@brettcannon
Copy link
Member

I can't reproduce the environment on Windows, so a teammate running Linux will need to give it a try. And so no one else has to look it up, running conda env create -f issue3869_env.yml from a clone of the repo @jruizaranguren provided should get you up and running.

@d3r3kk d3r3kk self-assigned this Jan 10, 2019
@d3r3kk d3r3kk added the triage label Jan 10, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 10, 2019
@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug needs PR area-debugging and removed triage labels Jan 14, 2019
@d3r3kk
Copy link

d3r3kk commented Jan 14, 2019

This does indeed reproduce on Linux. I have grabbed a log file by running the test in the debugger (I added one line: pytest.main() at the end of the file and ran it under the 'Python: Current File (integrated terminal)' setting of launch.json). Attached.

debuglog_3869.zip

Settings.json file:

settings.json.zip

@d3r3kk d3r3kk removed their assignment Jan 14, 2019
@iban-rodriguez
Copy link

I'm also facing this problem with one of my projects. Impossible to start test debugging.

I'm working on Linux too and can reproduce the issue with @jruizaranguren environment.

@jbarbadillo
Copy link

With the following system configuration

  • VS Code version: 1.30.1
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): anaconda Python 3.6.7 64 bit

And @jruizaranguren environment I have the same problem with debugging. Before version 1.30.1 I could debug perfectly.

@brettcannon brettcannon added the important Issue identified as high-priority label Feb 14, 2019
@qubitron qubitron added this to the 2019, week 9 - Feb Sprint 5 milestone Feb 26, 2019
@brettcannon brettcannon removed this from the 2019, week 9 - Feb Sprint 5 milestone Feb 28, 2019
@jxramos
Copy link

jxramos commented Mar 1, 2019

This reproduces on MacOS as well.

Code Version 1.31.1 (1.31.1)
macOS High Sierra (10.13.4)
Python Extension: Version: 2019.2.5433

One more point to update, it does appear to be source specific in some way, I just crafted a simple Greenfield python module and the debugger is playing fine there. In my more complex modules its hanging and the debugger's debug log output doesn't appear to have anything too revealing when searching for keywords error, fail, or warn

@luabud luabud removed the important Issue identified as high-priority label Mar 12, 2019
@jxramos
Copy link

jxramos commented May 3, 2019

This behavior no longer appears to reproduce after the recent upgrade:

Code Version 1.33.1 (1.33.1)
Python Extension: 2019.4.12954

However it seems to have been replaced with issue 5540.

I may add some clarification too with debug behavior I witnessed in the past. Whenever I made a python syntax error if I attempted to run the debugger it would hang indefinitely and I'd have to force kill the debug session. I would then often invoke Start without debugging to shake out any syntax errors before reattempting a debug session. I'd also invoke my scripts to trigger them to print their help messages to ensure syntax errors didn't slip through. There was a certain reproducible behavior around syntax errors and hanging the debugger. I haven't seen it recently however.

@jruizaranguren
Copy link
Author

I'm experiencing the same issue with last versions:

Code Version: 1.36.1
Python Extension: 2019.8.29288
Anaconda Extension Pack: 1.0.1

Any hint? Is it just with complex environments?

@jbarbadillo
Copy link

I am experiencing same issue with last versions too.

Code Version: 1.38.0

@vgonisanz
Copy link

vgonisanz commented Oct 15, 2019

I have the same problem. If I click on debug test, then running test message appear at the bottom, and after a second, no tests ran. No debug running works.

Code Version: 1.39.1
Python Version: Python 3.6.9 :: Anaconda, Inc.

@marsmith
Copy link

marsmith commented Oct 16, 2019

I'm having the same issue. Additionally, I can't seem to run individual tests. They are just hanging with the 'loading' spinner. This was working fine before 1.39.1

image

@DonJayamanne DonJayamanne mentioned this issue Oct 25, 2019
24 tasks
@luabud
Copy link
Member

luabud commented Oct 25, 2019

@marsmith the second issue you mentioned is this one: microsoft/vscode#82629. It needs to be fixed in VS Code.

For the others in this thread, I believe these issues may be conda issues. Which version of conda are you using?

@gramster gramster added this to the FY20Q2 milestone Oct 30, 2019
@ghost
Copy link

ghost commented Apr 16, 2020

It's still happening all the time on MacOS. Python extension 2020.3.71659, Python 3.7.7, VS Code 1.44.1. I don't use conda.

@luabud
Copy link
Member

luabud commented Apr 16, 2020

Hi @digger, would you mind filing a separate issue with repro steps and any screenshots that may seem relevant? I think this may be happening for a different reason, as we started using a new debugger. Thanks! 😊

@ghost
Copy link

ghost commented Apr 16, 2020

Hi @luabud, I filed #11219. I've been using vscode for about a year and this has always been an issue with the python debugger.

@luabud
Copy link
Member

luabud commented Mar 16, 2021

This issue seems to be stale, so I'm closing it. If anyone still has any issues please do file a separate bug report! Thank you :)

@luabud luabud closed this as completed Mar 16, 2021
@ghost ghost removed the needs PR label Mar 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug linux
Projects
None yet
Development

No branches or pull requests