Skip to content

bpo-31904: Fix test_os failures for VxWorks RTOS #12319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -1418,9 +1418,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)
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 @@ -1516,7 +1527,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.")
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.