As discusssed in https://bugs.python.org/issue6083#msg314264 . diff --git a/Python/Lib/test/test_resource.py b/Python/Lib/test/test_resource.py index de29d3b..27a1573 100644 --- a/Python/Lib/test/test_resource.py +++ b/Python/Lib/test/test_resource.py @@ -102,16 +102,21 @@ class ResourceTest(unittest.TestCase): # Issue 6083: Reference counting bug def test_setrusage_refcount(self): + howmany = 1000000 try: limits = resource.getrlimit(resource.RLIMIT_CPU) except AttributeError: self.skipTest('RLIMIT_CPU not available') + try: + resource.setrlimit(resource.RLIMIT_CPU, (howmany, howmany)) + except (ValueError, OSError): + self.skipTest('Setting RLIMIT_CPU not possible') class BadSequence: def __len__(self): return 2 def __getitem__(self, key): if key in (0, 1): - return len(tuple(range(1000000))) + return len(tuple(range(howmany))) raise IndexError resource.setrlimit(resource.RLIMIT_CPU, BadSequence())