-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
test_tools leaks randomly references on x86 Gentoo Refleaks 3.6 and 3.x #75357
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
Comments
The "x86 Gentoo Refleaks 3.x" buildbot runs tests using -u-cpu to disable the cpu resource. The problem is that DirectoryTestCase.test_files() of Lib/test/test_tools/test_unparse.py uses random: # Test limited subset of files unless the 'cpu' resource is specified.
if not test.support.is_resource_enabled("cpu"):
names = random.sample(names, 10) So when we run the same test 7 times, each run uses different data. I see different options:
The random issue is more generic than just test_unparse.py, and so it would be interesting to explore this path. Maybe the random issue explains why some other tests fail randomly. libregrtest always seeds the random RNG using a seed displayed on the standard output. We should either reuse this seed, or create a new unique seed for each test file, and display it (to be able to reproduce tests). Reseed random before running each test file can also helps to make tests more reproductible -- test_tools leaked [1, 4, 2] memory blocks, sum=7 |
I created bpo-31227: "regrtest: reseed random with the same seed before running a test file". |
test_tools also fails on x86 Gentoo Refleaks 3.6: http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.6/builds/90 test_tools leaked [1, 1, 118] memory blocks, sum=120 |
"test_tools leaked (...)" still occurs randomly on 3.6 and 3.x Gentoo buildbot. |
My previous attempt, PR 3059, was a a very generic fix, but my bpo-31227 idea was rejected. I proposed a new idea, PR 4102, which is restricted to this specific issue: |
Python 2.7 is not affected. Even if Python 2.7 has Demo/parser/test_unparse.py, this test is not part of the Python test suite, and it doesn't use random.sample(names, 10). |
The bug should now be fixed. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: