Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(263440)

Unified Diff: Lib/test/test_multiprocessing.py

Issue 12156: test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -115,6 +115,25 @@
Structure = object
c_int = c_double = None
+
+def check_enough_semaphores():
+ """Check that the system supports enough semaphores to run the test."""
+ try:
+ nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
+ except (AttributeError, ValueError):
+ # sysconf not available or setting not available
+ return
+ if nsems_max == -1:
+ # indetermine limit, assume that limit is determined by available memory
+ # only
+ return
+ if nsems_max >= 256:
+ # minimum number of semaphores available according to POSIX
+ return
+ raise unittest.SkipTest("The OS doesn't support enough semaphores "
+ "to run the test.")
+
+
#
# Creates a wrapper for a function which records the time it takes to finish
#
@@ -2349,6 +2368,8 @@
except OSError:
raise unittest.SkipTest("OSError raises on RLock creation, see issue 3111!")
+ check_enough_semaphores()
+
if run is None:
from test.support import run_unittest as run
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+