jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python37 / patches / 20-test_fixes.patch
blob0e4f80f79c6cf0b4dd5caf3a90457c97898b71d2
1 This patch disables several tests that doesn't work correctly on Solaris.
3 test_gdb is not deterministic and sometimes fails for unimportant reasons (only
4 when ran with gmake test from component root). Same is true for on ofe the
5 test_normalization tests. [Not for upstream]
7 test_time changes used locale to region specific utf8 as python is not able to
8 work with non utf8 region specific encodings in Solaris. [Not for upstream].
9 Second change changes skip reason string to reflect the actual platform.
10 [Can be offered upstream]
12 test_socket fixes problem with sparc specific behavior of CMSG_SPACE(). Needed
13 values are not linear as the test expects and that might cause an exception for
14 last byte. Other problems in this test are related to known issues also
15 affecting other platforms. [Can be atleast reported upstream]
17 test_socket also disables testRecvmsgTrunc because MSG_TRUNC flag on Solaris is
18 currently broken (see 29193312) [Not for upstream].
20 test_structures is related to known bad support of reference passing on many
21 platforms. This just skips given test [Not for upstream].
23 test_re those two test are probably also locale related but I have no idea what
24 is the root cause of these... [Should be reported upstream]
26 test_float changes encodings for the same reason as in test_time.
27 [Not for upstream]
29 test_faulthandler is segfaulting on intel in this test (end of program with
30 registered faulthandler with chain=True). This bug was reported upstream.
31 [https://bugs.python.org/issue35484]
33 test_site is not deterministic and sometimes fails not sure why.
34 [Not for upstream]
36 --- Python-3.7.4/Lib/test/test_gdb.py
37 +++ Python-3.7.4/Lib/test/test_gdb.py
38 @@ -45,6 +45,8 @@ if gdb_major_version < 7:
39 "embedding. Saw %s.%s:\n%s"
40 % (gdb_major_version, gdb_minor_version,
41 gdb_version))
42 +if sys.platform.startswith("sunos"):
43 + raise unittest.SkipTest("test doesn't work well on Solaris")
45 if not sysconfig.is_python_build():
46 raise unittest.SkipTest("test_gdb only works on source builds at the moment.")
47 --- Python-3.7.4/Lib/test/test_normalization.py
48 +++ Python-3.7.4/Lib/test/test_normalization.py
49 @@ -36,6 +36,8 @@ def unistr(data):
51 class NormalizationTest(unittest.TestCase):
52 def test_main(self):
53 + if sys.platform.startswith("sunos"):
54 + self.skipTest("test doesn't work well on Solaris")
55 # Hit the exception early
56 try:
57 testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
58 --- Python-3.7.4/Lib/test/test_time.py
59 +++ Python-3.7.4/Lib/test/test_time.py
60 @@ -583,9 +583,9 @@ class TestLocale(unittest.TestCase):
62 def test_bug_3061(self):
63 try:
64 - tmp = locale.setlocale(locale.LC_ALL, "fr_FR")
65 + tmp = locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8")
66 except locale.Error:
67 - self.skipTest('could not set locale.LC_ALL to fr_FR')
68 + self.skipTest('could not set locale.LC_ALL to fr_FR.UTF-8')
69 # This should not cause an exception
70 time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
72 @@ -626,7 +626,7 @@ class _TestStrftimeYear:
73 self.test_year('%04d', func=year4d)
75 def skip_if_not_supported(y):
76 - msg = "strftime() is limited to [1; 9999] with Visual Studio"
77 + msg = "strftime() is limited to [1; 9999] on %s" % sys.platform
78 # Check that it doesn't crash for year > 9999
79 try:
80 time.strftime('%Y', (y,) + (0,) * 8)
81 --- Python-3.7.4/Lib/test/test_socket.py
82 +++ Python-3.7.4/Lib/test/test_socket.py
83 @@ -2715,6 +2715,8 @@ class RecvmsgGenericTests(SendrecvmsgBas
84 def _testRecvmsgShorter(self):
85 self.sendToServer(MSG)
87 + @unittest.skipIf(sys.platform.startswith("sunos"),
88 + "skipping, MSG_TRUNC flag on Solaris is currently broken (see 29193312)")
89 def testRecvmsgTrunc(self):
90 # Receive part of message, check for truncation indicators.
91 msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
92 @@ -3009,7 +3011,7 @@ class CmsgMacroTests(unittest.TestCase):
93 # Test CMSG_SPACE() with various valid and invalid values,
94 # checking the assumptions used by sendmsg().
95 toobig = self.socklen_t_limit - socket.CMSG_SPACE(1) + 1
96 - values = list(range(257)) + list(range(toobig - 257, toobig))
97 + values = list(range(257)) + list(range(toobig - 257, toobig - 8))
99 last = socket.CMSG_SPACE(0)
100 # struct cmsghdr has at least three members, two of which are ints
101 @@ -3156,6 +3158,7 @@ class SCMRightsTest(SendrecvmsgServerTim
103 @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
104 @unittest.skipIf(sys.platform.startswith("aix"), "skipping, see issue #22397")
105 + @unittest.skipIf(sys.platform.startswith("sunos"), "skipping, see issue #12958")
106 @requireAttrs(socket, "CMSG_SPACE")
107 def testFDPassSeparate(self):
108 # Pass two FDs in two separate arrays. Arrays may be combined
109 @@ -3167,6 +3170,7 @@ class SCMRightsTest(SendrecvmsgServerTim
110 @testFDPassSeparate.client_skip
111 @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
112 @unittest.skipIf(sys.platform.startswith("aix"), "skipping, see issue #22397")
113 + @unittest.skipIf(sys.platform.startswith("sunos"), "skipping, see issue #12958")
114 def _testFDPassSeparate(self):
115 fd0, fd1 = self.newFDs(2)
116 self.assertEqual(
117 @@ -3180,6 +3184,7 @@ class SCMRightsTest(SendrecvmsgServerTim
119 @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
120 @unittest.skipIf(sys.platform.startswith("aix"), "skipping, see issue #22397")
121 + @unittest.skipIf(sys.platform.startswith("sunos"), "skipping, see issue #12958")
122 @requireAttrs(socket, "CMSG_SPACE")
123 def testFDPassSeparateMinSpace(self):
124 # Pass two FDs in two separate arrays, receiving them into the
125 @@ -3194,6 +3199,7 @@ class SCMRightsTest(SendrecvmsgServerTim
126 @testFDPassSeparateMinSpace.client_skip
127 @unittest.skipIf(sys.platform == "darwin", "skipping, see issue #12958")
128 @unittest.skipIf(sys.platform.startswith("aix"), "skipping, see issue #22397")
129 + @unittest.skipIf(sys.platform.startswith("sunos"), "skipping, see issue #12958")
130 def _testFDPassSeparateMinSpace(self):
131 fd0, fd1 = self.newFDs(2)
132 self.assertEqual(
133 --- Python-3.7.4/Lib/ctypes/test/test_structures.py
134 +++ Python-3.7.4/Lib/ctypes/test/test_structures.py
135 @@ -397,6 +397,8 @@ class StructureTestCase(unittest.TestCas
136 (1, 0, 0, 0, 0, 0))
137 self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7))
139 + @unittest.skipIf(sys.platform.startswith("sunos"),
140 + "test doesn't work well on sparc Solaris")
141 def test_pass_by_value(self):
142 # This should mirror the structure in Modules/_ctypes/_ctypes_test.c
143 class X(Structure):
144 --- Python-3.7.4/Lib/test/test_re.py
145 +++ Python-3.7.4/Lib/test/test_re.py
146 @@ -1,5 +1,6 @@
147 from test.support import (gc_collect, bigmemtest, _2G,
148 cpython_only, captured_stdout)
149 +import sys
150 import locale
151 import re
152 import sre_compile
153 @@ -1893,6 +1894,8 @@ ELSE
154 self.assertTrue(re.match(b'(?Li)\xc5', b'\xe5'))
155 self.assertTrue(re.match(b'(?Li)\xe5', b'\xc5'))
157 + @unittest.skipIf(sys.platform.startswith("sunos"),
158 + "test doesn't work well on sparc Solaris")
159 def check_en_US_utf8(self):
160 locale.setlocale(locale.LC_CTYPE, 'en_US.utf8')
161 self.assertTrue(re.match(b'\xc5\xe5', b'\xc5\xe5', re.L|re.I))
162 @@ -1902,6 +1905,8 @@ ELSE
163 self.assertIsNone(re.match(b'(?Li)\xc5', b'\xe5'))
164 self.assertIsNone(re.match(b'(?Li)\xe5', b'\xc5'))
166 + @unittest.skipIf(sys.platform.startswith("sunos"),
167 + "test doesn't work well on sparc Solaris")
168 def test_locale_compiled(self):
169 oldlocale = locale.setlocale(locale.LC_CTYPE)
170 self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
171 --- Python-3.7.4/Lib/test/test_float.py
172 +++ Python-3.7.4/Lib/test/test_float.py
173 @@ -144,7 +144,7 @@ class GeneralFloatCases(unittest.TestCas
174 # non-UTF-8 byte string
175 check(b'123\xa0')
177 - @support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
178 + @support.run_with_locale('LC_NUMERIC', 'fr_FR.UTF-8', 'de_DE.UTF-8')
179 def test_float_with_comma(self):
180 # set locale to something that doesn't use '.' for the decimal point
181 # float must not accept the locale specific decimal point but
182 --- Python-3.7.4/Lib/test/test_faulthandler.py
183 +++ Python-3.7.4/Lib/test/test_faulthandler.py
184 @@ -720,6 +720,7 @@ class FaultHandlerTests(unittest.TestCas
185 def test_register_threads(self):
186 self.check_register(all_threads=True)
188 + @unittest.skipIf(sys.platform.startswith("sunos"), "sometimes fails on Solaris")
189 def test_register_chain(self):
190 self.check_register(chain=True)
192 --- Python-3.7.5/Lib/test/test_site.py
193 +++ Python-3.7.5/Lib/test/test_site.py
194 @@ -503,6 +503,8 @@ class ImportSideEffectTests(unittest.Tes
196 class StartupImportTests(unittest.TestCase):
198 + @unittest.skipIf(sys.platform.startswith("sunos"),
199 + "test doesn't work well on sparc Solaris")
200 def test_startup_imports(self):
201 # This tests checks which modules are loaded by Python when it
202 # initially starts upon startup.