jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python37 / patches / 16-test-vmlimit.patch
blobad4183c47ae83b89523e76740abb585990c322b8
1 This patch for a Solaris-specific problem but is a good safety precaution,
2 so although it is not suitable for upstream as-is, we might offer it in a
3 slightly tweaked form at some point in the future.
5 Note that this can also have wrong inpact on other tests (e.g., imap which
6 tries to allocate huge chunks of virtual memory).
8 --- Python-3.7.4/Lib/test/libregrtest/setup.py
9 +++ Python-3.7.4/Lib/test/libregrtest/setup.py
10 @@ -58,6 +58,19 @@ def setup_tests(ns):
11 if getattr(module, '__file__', None):
12 module.__file__ = os.path.abspath(module.__file__)
14 + # The socket test goes crazy on Solaris, slurping up VM until the system
15 + # dies or the test is killed. So limit it to 8GB. While we could do this
16 + # in the socket test itself, it is more prudent to do it here in case any
17 + # other tests ever go crazy in a similar fashion.
18 + if sys.platform == 'sunos5':
19 + try:
20 + import resource
21 + except ImportError:
22 + pass
23 + else:
24 + vm_limit = 8589934592
25 + resource.setrlimit(resource.RLIMIT_VMEM, (vm_limit, vm_limit))
27 if ns.huntrleaks:
28 unittest.BaseTestSuite._cleanup = False