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

Debugger hangs when debugging pytest tests on gevent based code #18495

Closed
sradhakrishna opened this issue Feb 10, 2022 · 7 comments
Closed

Debugger hangs when debugging pytest tests on gevent based code #18495

sradhakrishna opened this issue Feb 10, 2022 · 7 comments

Comments

@sradhakrishna
Copy link

Issue Type: Bug

Issue: Debugger hangs when debugging pytest tests on gevent based code

Steps to reproduce:

  1. Clone repo from https://github.com/sradhakrishna/test-nameko
  2. Open workspace, set Automatic tasks on Folder Open task
  3. Relaunch workspace; should setup a virtualenv .venv in the root folder. (Refer to .setupworkspace.sh for details)
  4. Open test_serviceb.py, set a breakpoint in test_event_interface, and launch debug test from test pane.
  5. You'll notice that the debugger hangs.

Expected behavior: Should be able to launch debug sessions from tests pane.

Extension version: 2022.0.1814523869
VS Code version: Code 1.64.0 (Universal) (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:20:17.224Z)
OS version: Darwin x64 21.2.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 3
Memory (System) 32.00GB (0.79GB free)
Process Argv --crash-reporter-id 1d4acee8-c892-481f-9175-595f87e67243
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30425749
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dsc:30433058
pythonvs932:30410667
wslgetstarted:30433507
vscop940:30404999
vsrem710:30416614

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 10, 2022
@karthiknadig
Copy link
Member

in your launch json do you use gevent = true? see here microsoft/debugpy#515 (comment)

@sradhakrishna
Copy link
Author

sradhakrishna commented Feb 10, 2022 via email

@karthiknadig
Copy link
Member

@sradhakrishna Add a configuration like this:

        {
            "name": "(test debug only)",
            "type": "python",
            "request": "launch",
            "gevent": true,
            "purpose": ["debug-test"]
        }

@sradhakrishna
Copy link
Author

Added configuration here: https://github.com/sradhakrishna/test-nameko/blob/0259b45b4b269fafbb7de699d293ee446bfaae2c/workspace.code-workspace#L20.

Is this right? I am still not able to debug code - the debugger is still hanging.

For whatever its worth, here's the output of pip freeze:

$ pip freeze
amqp==2.6.1
atomicwrites==1.4.0
attrs==21.4.0
certifi==2021.10.8
charset-normalizer==2.0.11
dnspython==2.2.0
eventlet==0.32.0
greenlet==1.1.2
idna==3.3
kombu==4.6.11
mock==4.0.3
more-itertools==8.12.0
nameko==2.12.0
path==16.3.0
path.py==12.5.0
pluggy==0.6.0
py==1.11.0
pytest==3.6.3
pytest-dotenv==0.5.0
pytest-eventlet==1.0.0
pytest-pythonpath==0.7.3
python-dotenv==0.19.2
PyYAML==6.0
requests==2.27.1
six==1.16.0
urllib3==1.26.8
vine==1.3.0
Werkzeug==2.0.3
wrapt==1.13.3

Am I missing anything?

@karthiknadig
Copy link
Member

karthiknadig commented Feb 10, 2022

That won't work, we don't pick up the debug configuration from the settings. you have to add it to the launch.json file.

We have an issue open to load the config for tests from settings. (#17644)

@sradhakrishna
Copy link
Author

I've moved launch configurations to launch.json - and am able to debug now! Thanks a lot, @karthiknadig !

Will follow progress on #17644.

@sradhakrishna
Copy link
Author

Am closing this issue as resolved. Thanks again!

@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Feb 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants