Skip to content

Commit 693c104

Browse files
LihuaZhaovstinner
authored andcommitted
bpo-31904: Port test_resource to VxWorks (GH-12719)
Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.
1 parent 2954550 commit 693c104

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Doc/library/resource.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ this module for those platforms.
7676
``setrlimit`` may also raise :exc:`error` if the underlying system call
7777
fails.
7878

79+
VxWorks only supports setting :data:`RLIMIT_NOFILE`.
80+
7981
.. function:: prlimit(pid, resource[, limits])
8082

8183
Combines :func:`setrlimit` and :func:`getrlimit` in one function and

Lib/test/test_resource.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def test_args(self):
1616
self.assertRaises(TypeError, resource.setrlimit)
1717
self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)
1818

19+
@unittest.skipIf(sys.platform == "vxworks",
20+
"setting RLIMIT_FSIZE is not supported on VxWorks")
1921
def test_fsize_ismax(self):
2022
try:
2123
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
@@ -110,6 +112,8 @@ def test_getrusage(self):
110112
pass
111113

112114
# Issue 6083: Reference counting bug
115+
@unittest.skipIf(sys.platform == "vxworks",
116+
"setting RLIMIT_CPU is not supported on VxWorks")
113117
def test_setrusage_refcount(self):
114118
try:
115119
limits = resource.getrlimit(resource.RLIMIT_CPU)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port test_resource to VxWorks: skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU.

0 commit comments

Comments
 (0)