-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
coverage==4.0 hangs indefinitely on python2.7 + windows #420
Comments
For some reason, pytest is stopping at this line: https://github.com/pytest-dev/pytest/blob/master/_pytest/capture.py#L340 I don't know why it only happens under coverage.py, or why only in this repo. |
Original comment by Ionel Cristian Mărieș (Bitbucket: ionelmc, GitHub: ionelmc) It would appear this is the minimal reproduce instructions (for now): Put this in a
And then run:
It would appear that the conftest gets run somewhere in the middle of pytest initializing all the plugins (including the capture plugin). |
Original comment by Ionel Cristian Mărieș (Bitbucket: ionelmc, GitHub: ionelmc) Some WinDbg session for that here http://imgur.com/oEj06YD&MofncLw&QjMdaSz Tho the stack look unbelievable. Maybe WinDbg failed to get the right symbols coverage's C extension. |
Original comment by Anthony Sottile (Bitbucket: asottile, GitHub: asottile) So I went to bisect this and I can't seem to reproduce when checking out the tagged I'm using the git mirror because I understand git (for bisect) way better than I do mercurial. # C:\Users\Anthony\Desktop\git\coveragepy [(coverage-4.0) +5 ~0 -0 !]> cat .\asottile\asottile.py
import subprocess
import traceback
import threading
SUCCESS = 0
TIMEOUT = 1
FAILED = 2
def call_with_timeout(*cmd, **kwargs):
timeout = kwargs.pop('timeout', 10)
class out:
pass
def execute_command():
out.proc = subprocess.Popen(cmd, **kwargs)
out.proc.communicate()
if out.proc.returncode:
out.reason = FAILED
else:
out.reason = SUCCESS
thread = threading.Thread(target=execute_command)
thread.start()
thread.join(timeout)
if thread.is_alive():
out.proc.terminate()
thread.join()
out.reason = TIMEOUT
return out.reason
def main():
try:
subprocess.check_call(('rm', '-rf', 'venv'))
subprocess.check_call(('virtualenv', 'venv'))
subprocess.check_call(('venv/Scripts/pip.exe', 'install', '.', 'pytest'))
except Exception:
print('*' * 79)
print('Assuming not installable')
print('*' * 79)
traceback.print_exc()
return 0
return call_with_timeout('venv/Scripts/coverage.exe', 'run', '-m', 'pytest', '--help', timeout=2)
if __name__ == '__main__':
exit(main()) With this (checked out at https://github.com/nedbat/coveragepy/releases/tag/coverage-4.0), I get the following:
However if I modify my script to just be: C:\Users\Anthony\Desktop\git\coveragepy [(coverage-4.0) +4 ~0 -0 !]> C:\\Users\\Anthony\\AppData\\Local\\GitHub\\PortableGit_c2ba306e5
36fdf878271f7fe636a147ff37326ad\\bin\diff.exe -u .\asottile\asottile.py .\asottile\asottile2.py
--- .\asottile\asottile.py Mon Oct 5 19:19:09 2015
+++ .\asottile\asottile2.py Mon Oct 5 19:19:28 2015
@@ -38,7 +38,7 @@
try:
subprocess.check_call(('rm', '-rf', 'venv'))
subprocess.check_call(('virtualenv', 'venv'))
- subprocess.check_call(('venv/Scripts/pip.exe', 'install', '.', 'pytest'))
+ subprocess.check_call(('venv/Scripts/pip.exe', 'install', 'coverage', 'pytest'))
except Exception:
print('*' * 79)
print('Assuming not installable') I get:
Maybe a bad wheel? |
Original comment by Anthony Sottile (Bitbucket: asottile, GitHub: asottile) Bisect points at this commit:
|
Original comment by Anthony Sottile (Bitbucket: asottile, GitHub: asottile) For what it's worth here's a simpler reproduction. Removing any line here causes it to pass. # test.py
import test2 # test2.py
import subprocess
subprocess.Popen(
('echo',),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
).communicate() And |
The troublesome commit is 2ff50c9162ce (bb), and it also is the apparent cause of #445.... |
Fixed in 231bad38c241 (bb) |
Original comment by Anthony Sottile (Bitbucket: asottile, GitHub: asottile) Yay, seems fixed: (ignore the sha, that's from the git repo I mercurial cloned in a subdir (sanity is not always my forte))
|
Originally reported by Anthony Sottile (Bitbucket: asottile, GitHub: asottile)
The reproduction here is a bit complicated because I haven't quite narrowed it down yet but here goes.
I noticed this initially when my build was running indefinitely (and eventually failing) here : https://ci.appveyor.com/project/asottile/pre-commit/branch/master/job/r57jhonel6dlgd9d
My "minimal" reproduction is as follows:
I've attached a screenshot (the contrast sucks because the window froze on my VM)
The text was updated successfully, but these errors were encountered: