Message325293
test_prlimit tries to test that raising the hardlimit of an unprivileged process. It tries to raise the hardlimit of pid 1, which usually raises a PermissionError. However, if the tests are privileged, this test can't work. The test tries to avoid this by only running the test if os.geteuid() != 0. However, there are other cases. For example, if the test process isn't root but has CAP_SYS_RESOURCE. While we could check for these other cases, I think we should just delete this test. There's no special logic in the prlimit implementation for handling permission errors, so it's not adding much value.
======================================================================
FAIL: test_prlimit (test.test_resource.ResourceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/buildbot/buildarea/3.x.ware-alpine/build/Lib/test/support/__init__.py", line 587, in wrapper
return func(*args, **kw)
File "/buildbot/buildarea/3.x.ware-alpine/build/Lib/test/test_resource.py", line 152, in test_prlimit
1, resource.RLIMIT_AS)
AssertionError: PermissionError not raised by prlimit |
|
Date |
User |
Action |
Args |
2018-09-13 20:31:39 | benjamin.peterson | set | recipients:
+ benjamin.peterson |
2018-09-13 20:31:38 | benjamin.peterson | set | messageid: <1536870698.96.0.956365154283.issue34668@psf.upfronthosting.co.za> |
2018-09-13 20:31:38 | benjamin.peterson | link | issue34668 messages |
2018-09-13 20:31:38 | benjamin.peterson | create | |
|