Author imz
Recipients abacabadabacaba, belopolsky, billm, georg.brandl, gregory.p.smith, imz, loewis, python-dev, serhiy.storchaka
Date 2018-03-22.14:54:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521730489.77.0.467229070634.issue6083@psf.upfronthosting.co.za>
In-reply-to
Content
> New changeset a4c85f9b8f58 by Serhiy Storchaka in branch '2.7':
Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
http://hg.python.org/cpython/rev/a4c85f9b8f58

This test has a problem: though it tests not the ability to set a CPU hard limit, it fails if the hard limit is limited. Perhaps, ignore any exception there? Could you please help me re-write it correctly, so that I can run it on gyle--ALT's builder host--successfully):

    # Issue 6083: Reference counting bug
    def test_setrusage_refcount(self):
        try:
            limits = resource.getrlimit(resource.RLIMIT_CPU)
        except AttributeError:
            self.skipTest('RLIMIT_CPU not available')
        class BadSequence:
            def __len__(self):
                return 2
            def __getitem__(self, key):
                if key in (0, 1):
                    return len(tuple(range(1000000)))
                raise IndexError

        resource.setrlimit(resource.RLIMIT_CPU, BadSequence())

The failure:

[builder@team ~]$ python /usr/lib64/python2.7/test/test_resource.py
test_args (__main__.ResourceTest) ... ok
test_fsize_enforced (__main__.ResourceTest) ... ok
test_fsize_ismax (__main__.ResourceTest) ... ok
test_fsize_toobig (__main__.ResourceTest) ... ok
test_getrusage (__main__.ResourceTest) ... ok
test_setrusage_refcount (__main__.ResourceTest) ... ERROR

======================================================================
ERROR: test_setrusage_refcount (__main__.ResourceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 117, in test_setrusage_refcount
    resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
ValueError: not allowed to raise maximum limit

----------------------------------------------------------------------
Ran 6 tests in 0.085s

FAILED (errors=1)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 123, in <module>
    test_main()
  File "/usr/lib64/python2.7/test/test_resource.py", line 120, in test_main
    test_support.run_unittest(ResourceTest)
  File "/usr/lib64/python2.7/test/support/__init__.py", line 1577, in run_unittest
    _run_suite(suite)
  File "/usr/lib64/python2.7/test/support/__init__.py", line 1542, in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "/usr/lib64/python2.7/test/test_resource.py", line 117, in test_setrusage_refcount
    resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
ValueError: not allowed to raise maximum limit

[builder@team ~]$
History
Date User Action Args
2018-03-22 14:54:49imzsetrecipients: + imz, loewis, georg.brandl, gregory.p.smith, belopolsky, billm, abacabadabacaba, python-dev, serhiy.storchaka
2018-03-22 14:54:49imzsetmessageid: <1521730489.77.0.467229070634.issue6083@psf.upfronthosting.co.za>
2018-03-22 14:54:49imzlinkissue6083 messages
2018-03-22 14:54:49imzcreate