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

tracer hangs only in Windows #1410

Open
tikuma-lsuhsc opened this issue Jun 24, 2022 · 2 comments
Open

tracer hangs only in Windows #1410

tikuma-lsuhsc opened this issue Jun 24, 2022 · 2 comments
Labels
bug Something isn't working windows

Comments

@tikuma-lsuhsc
Copy link

Describe the bug

(I'm crossposting SO post as I'm begin understanding how coverage test is working.)

I've been working on a PR for rpy2 package to improve its support for Windows, and the provided pytest test hangs while running coverage.py's tracer only in Windows.

  • The code base appears not to use any of the things mentioned in "Things that cause trouble."
  • This test has been in use with GitHub Action for some time with my understanding (Windows test was never reached as the test previously failed in its earlier stage.)

To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using?
Python 3.9.7
  1. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
coverage              6.4.1
  1. What versions of what packages do you have installed? The output of pip freeze is helpful.
Package               Version
--------------------- -----------
atomicwrites          1.4.0
attrs                 21.4.0
certifi               2022.5.18.1
cffi                  1.15.0
charset-normalizer    2.0.12
codecov               2.1.12
colorama              0.4.4
coverage              6.4.1
idna                  3.3
iniconfig             1.1.1
Jinja2                3.1.2
MarkupSafe            2.1.1
packaging             21.3
pip                   22.1.2
pluggy                1.0.0
py                    1.11.0
pycparser             2.21
pyparsing             3.0.9
pytest                7.1.2
pytest-cov            3.0.0
pytz                  2022.1
pytz-deprecation-shim 0.1.0.post0
requests              2.28.0
rpy2                  3.5.3
setuptools            62.3.2
tomli                 2.0.1
tzdata                2022.1
tzlocal               4.2
urllib3               1.26.9
wheel                 0.37.1
  1. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.

fix/win_r_home branch of rpy2 fork

  1. What commands did you run?
coverage run --source rpy2.robjects.lib -m pytest rpy2/tests/robjects/lib

This command hangs after printing:

============================================= test session starts ==============================================
platform win32 -- Python 3.9.7, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\Users\tikum\Documents\Python\rpy2
plugins: cov-3.0.0
collecting ... 

Under a debugger, I can follow up until it reaches coverage.py's Collector._start_tracer() (collector.py Line 278):

        fn = tracer.start()

Then, it enters tracer external module and never comes back out.

Removing --source rpy2.robjects.lib argument makes the coverage to run normally. You can find the robjects/lib subpackage here:

https://github.com/tikuma-lsuhsc/rpy2/tree/fix/win_r_home/rpy2/robjects/lib

Expected behavior

Not getting stuck...

Additional context

rpy2 package is a wrapper for R software and the target source modules do interact with R at the time of import.

@nedbat
Copy link
Owner

nedbat commented Nov 4, 2022

Hi, sorry this has taken me a while to get to. It looks like your pull request was rpy2/rpy2#889. It's now merged, does that mean the hang is fixed? I can't tell from the comments there, and I don't have a Windows environment to test in.

@nedbat nedbat added question Further information is requested and removed needs triage labels Nov 4, 2022
@tikuma-lsuhsc
Copy link
Author

I think the owner of rpy2 let it slide for Windows coverage check (like you he's on non-Windows platform). I caught this behavior when I was testing my PR independently from the CI. I'm suspecting the tracer does not line a certain lines in the robjects/lib code, but that's about as far as I could track down.

@nedbat nedbat added windows and removed question Further information is requested labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

No branches or pull requests

2 participants