bpo-31904: Skip setting RLIMIT_FSIZE and RLIMIT_CPU test case for VxWorks by LihuaZhao · Pull Request #12719 · python/cpython

@LihuaZhao

set RLIMIT_FSIZE and RLIMIT_CPU

@LihuaZhao

vstinner

# an error.
self.assertEqual(resource.RLIM_INFINITY, max)
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
if _support_rlimit_fsize_set:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the 2 constants and add a decorator to the function:

@skipIf(sys.platform == "vxworks", "setting RLIMIT_FSIZE is not supported on VxWorks")

And make a similar change for the other function.

@LihuaZhao

@LihuaZhao

I have made the requested changes; please review again.

@bedevere-bot

Thanks for making the requested changes!

: please review the changes made to this pull request.

vstinner

@@ -0,0 +1 @@
Skip setting RLIMIT_FSIZE and RLIMIT_CPU test case for VxWorks

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this NEWS entry to the Misc/NEWS.d/next/Tests/ directory, and mention the name of the fixed test, for example:

Port test_resource to VxWorks: skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU.
``setrlimit`` may also raise :exc:`error` if the underlying system call
fails.

VxWorks only support setting RLIMIT_NOFILE and idtype must be P_PID.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"supports" with a S, no? (I'm not sure, English is not my first language!) Please use :data: to format properly the RLIMIT_NOFILE constant.

VxWorks only support setting RLIMIT_NOFILE and idtype must be P_PID.
VxWorks only supports setting :data:`RLIMIT_NOFILE` and idtype must be P_PID.

I don't understand "idtype must be P_PID": what does it mean? Is it something specific to VxWorks?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's VxWorks specific requires.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove that statements for python user doesn't need to care about it.

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@LihuaZhao

@LihuaZhao

I have made the requested changes; please review again.

@bedevere-bot

Thanks for making the requested changes!

@vstinner: please review the changes made to this pull request.

vstinner

@pxinwr pxinwr deleted the fix-resource-limite branch

July 12, 2021 09:40