You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
running test_ctypes 25 times in a row causes it to fail #45938
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/theller'closed_at=<Date2007-12-12.17:46:44.461>created_at=<Date2007-12-11.23:41:07.842>labels= []
title='running test_ctypes 25 times in a row causes it to fail'updated_at=<Date2007-12-12.20:33:51.118>user='https://github.com/gvanrossum'
Also, when using -R:19, I get some random leaks reported of 33 or -33
references leaked. Does this test use threads? It seems to have a race
condition.
Thanks! (I agree with Eric Smith that this is mysterious for the
innocent bystander.)
I have added a comment.
Also, what about the -33/+33 leaks? I suppose these are harmless, but
it would be better if the test reliably didn't report leaks...
I am using my own definition of leaking: a test is leaking if references
grow without bounds ;-).
Ok, I found that the test in charge is Lib/ctypes/test/test_loading.py,
LoaderTest.test_find. This test uses the ctypes.util.find_library function,
which contains several calls to os.popen(...).read().
The minimal code reporting the -33/+33 leaks that I found is simply this:
os.popen('ls').read()
Is there a problem in "os.popen(...)", or do I something wrong here?
Activity
gvanrossum commentedon Dec 11, 2007
In debug mode, on my Ubuntu Linux box, this fails on the last iteration:
1 test failed:
test_ctypes
[104230 refs]
$
Also, when using -R:19, I get some random leaks reported of 33 or -33
references leaked. Does this test use threads? It seems to have a race
condition.
gvanrossum commentedon Dec 12, 2007
Thanks! (I agree with Eric Smith that this is mysterious for the
innocent bystander.)
Also, what about the -33/+33 leaks? I suppose these are harmless, but
it would be better if the test reliably didn't report leaks...
theller commentedon Dec 12, 2007
Guido van Rossum schrieb:
I have added a comment.
I am using my own definition of leaking: a test is leaking if references
grow without bounds ;-).
Ok, I found that the test in charge is Lib/ctypes/test/test_loading.py,
LoaderTest.test_find. This test uses the ctypes.util.find_library function,
which contains several calls to os.popen(...).read().
The minimal code reporting the -33/+33 leaks that I found is simply this:
os.popen('ls').read()
Is there a problem in "os.popen(...)", or do I something wrong here?
gvanrossum commentedon Dec 12, 2007
Try this instead:
IOW close the pipe explicitly. That should make the code execute in a
more reproducible fashion. I've fixed this in ctypes/util.py now:
r59477.
theller commentedon Dec 12, 2007
Cool! And the 'leak' is gone.