question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

debug test is hanging

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iban-rodriguezcommented, Jan 24, 2019

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.

1reaction
jruizarangurencommented, Jan 9, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio hangs when debugging a unit test
When debugging a unit test, Visual studio hangs until either the test ends or testhost.exe is killed. I'm using NUnit for unit testing,...
Read more >
Unit-test passes in Debug, but hangs when Run - Stack Overflow
I have a unit test that keeps getting stuck in Run Mode. When I run the same test in Debug, with no breakpoints,...
Read more >
How to debug freezing JUnit tests | by Piotr Zawadzki - Medium
On a CI server if a test hangs for a while but resumes eventually we can inspect JUnit reports and check if individual...
Read more >
How To Debug A Hanging Test Using Pytest - PyBites
Today a wanted to share a neat trick that might save you some headache: debugging a hanging test.
Read more >
Debugging Jest unit tests hangs
5. Running a jest test seems to work as expected, but when I switch to debug the same test, it hangs. I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found