Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cce75ba
support posix module on VxWorks
pxinwr Mar 1, 2019
f548045
update clinic for Modules/clinic/posixmodule.c.h
pxinwr Mar 1, 2019
b41b4d0
Run autoreconf
pxinwr Mar 1, 2019
3462991
add news file
pxinwr Mar 1, 2019
8de1134
bpo-31904: Add posix module support for VxWorks RTOS #12118
yuesun1 Mar 6, 2019
7354c9f
add the period mark in the os.rst
pxinwr Mar 8, 2019
8668612
revert aclocal.m4
pxinwr Mar 8, 2019
6f8e048
tune the lines in os.rst
pxinwr Mar 8, 2019
961f435
Merge remote-tracking branch 'upstream/master' into fix-issue-31904-os
pxinwr Mar 18, 2019
86091ad
update Modules/clinic/posixmodule.c.h
pxinwr Mar 18, 2019
5ea0755
Fix os.rst for spawnv() and spawnve() in OS module
yuesun1 Mar 19, 2019
30e9049
Merge remote-tracking branch 'upstream/master' into fix-issue-31904-os
pxinwr May 17, 2019
cf1a844
improve the test_urandom_failure and skip the ExecTests test cases in…
yuesun1 Mar 14, 2019
728165f
Add news file
yuesun1 Mar 14, 2019
36e955f
update clinic for Modules/clinic/posixmodule.c.h
pxinwr May 17, 2019
3716550
skip URandomFDTests in test_os.py for VxWorks
pxinwr May 17, 2019
c14d326
call PyErr_CheckSignals() on EINTR to respect the PEP 475 for waitpid
pxinwr May 17, 2019
a508f47
rephrase VxWorks' behaviour for spawn-like methods
pxinwr May 17, 2019
201212d
improve Doc/library/os.rst for VxWorks special behaviour
pxinwr May 17, 2019
da73b91
remove the separate NEWS entry for test part
pxinwr May 20, 2019
b380c49
add comments for calling rtpSpawn()
pxinwr May 21, 2019
7ada2ad
fix the typo in Doc/library/os.rst
pxinwr May 21, 2019
eb063a8
refine the skip message for ExecTests
pxinwr May 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -1419,9 +1419,20 @@ def test_urandom_failure(self):
import errno
import os
import resource

soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit))
try:
resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit))
except (ValueError,OSError):
for i in range(1, hard_limit + 1):
try:
os.open(os.devnull, os.O_RDONLY)
Copy link
Member

Choose a reason for hiding this comment

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

I dislike this code. If the limit is high (ex: larger than 1024), the test can take a lot of time.

I suggest to simply skip the test on VxWorks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Following your comments, skip this test on VxWorks. By default the RLIMIT_NOFILE on VxWorks is 8. But on other OS, perhaps there will be the issues you concerned.

except OSError as e:
if e.errno == errno.EMFILE:
break
else:
continue
else:
pass
try:
os.urandom(16)
except OSError as e:
Expand Down Expand Up @@ -1517,7 +1528,8 @@ def mock_execve(name, *args):
os.execve = orig_execve
os.defpath = orig_defpath


@unittest.skipUnless(hasattr(os, 'execv'),
"No os.execv or os.execve function to test.")
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: please align the string to the start of hasattr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

class ExecTests(unittest.TestCase):
@unittest.skipIf(USING_LINUXTHREADS,
"avoid triggering a linuxthreads bug: see issue #4970")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve the test_urandom_failure.
Skip the ExecTests test cases in test_os.py for VxWorks.
10 changes: 9 additions & 1 deletion Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.