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
on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest) #63552
Traceback (most recent call last):
File "/home/matej/Repos/cpython/Lib/test/test_resource.py", line 139, in test_linux_constantsself.assertIsInstance(resource.RLIMIT_RTTIME, int)
AttributeError: 'module' object has no attribute 'RLIMIT_RTTIME'
Do we really need to test these constants in unit test?
Other constants such as RLIMIT_STACK, RLIMIT_DATA, etc are not being tested. Other consideration includes people built custom kernel without these constants, or maybe they have outdated glibc.
Additionally, it is very uncommon to use os.uname in unittest. Other than this test, it is only Lib/test/test_locale.py that uses os.uname.
vajrasky commented on Oct 23, 2013
vajraskymannequin
Mannequin
More actions
Or if we really want to test these constants, we can use something like this:
Activity
mcepl commentedon Oct 22, 2013
With pure clone of https://github.com/python/cpython.git (no patches applied whatsoever, and the last commit is 650406f) and pure
./configure && make -j2 && make -j2 test I get one failed test:
======================================================================
ERROR: test_linux_constants (test.test_resource.ResourceTest)
----------------------------------------------------------------------
Ran 9 tests in 0.468s
FAILED (errors=1, skipped=1)
test test_resource failed
make: *** [test] Error 1
skrah commentedon Oct 22, 2013
Christian, could you have a look? I think this was added in bpo-19324.
tiran commentedon Oct 22, 2013
What's the output of "uname -r" on your machine?
tiran commentedon Oct 22, 2013
Patch with fix.
I'm checking the kernel version manually. requires_linux_version() works only per test. I don't want to write a test case for each attribute ...
vajrasky commentedon Oct 23, 2013
Do we really need to test these constants in unit test?
Other constants such as RLIMIT_STACK, RLIMIT_DATA, etc are not being tested. Other consideration includes people built custom kernel without these constants, or maybe they have outdated glibc.
Additionally, it is very uncommon to use os.uname in unittest. Other than this test, it is only Lib/test/test_locale.py that uses os.uname.
vajrasky commentedon Oct 23, 2013
Or if we really want to test these constants, we can use something like this:
Or if we want to be so strict:
Reference:
http://man7.org/conf/lca2006/Linux_2.6_changes/rlimit_5.html
RLIMIT_NICE (2.6.12)
mcepl commentedon Oct 23, 2013
On 22/10/13 20:43, Christian Heimes wrote:
2.6.32-358.23.2.el6.i686
vajrasky commentedon Oct 26, 2013
This issue has been accidentally fixed by http://hg.python.org/cpython/rev/513da56d28de commit.
Time to close it? Any last words?
brettcannon commentedon Oct 26, 2013
Since the test now passes I'm going to close this as fixed.