]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326) (#117331)
authorVictor Stinner <vstinner@python.org>
Thu, 28 Mar 2024 17:53:43 +0000 (18:53 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Mar 2024 17:53:43 +0000 (17:53 +0000)
gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326)

Add test.support.skip_on_s390x decorator.

(cherry picked from commit 6702d2bf6edcd5b5415e17837383623b9d76a5b8)

Lib/test/support/__init__.py
Lib/test/test_decimal.py

index dc7a6e6741b8bbb418547c99897aa04e592cdca1..059542c24335a2864aa9b1fedc2172c948c98c82 100644 (file)
@@ -56,6 +56,7 @@ __all__ = [
     "run_with_tz", "PGO", "missing_compiler_executable",
     "ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST",
     "LOOPBACK_TIMEOUT", "INTERNET_TIMEOUT", "SHORT_TIMEOUT", "LONG_TIMEOUT",
+    "skip_on_s390x",
     ]
 
 
@@ -2238,3 +2239,7 @@ def copy_python_src_ignore(path, names):
             'build',
         }
     return ignored
+
+#Windows doesn't have os.uname() but it doesn't support s390x.
+skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x',
+                                'skipped on s390x')
index f8e51a489bd29b408510e1d1d5c2a9b51a565568..a8324f98d052ea9bb019c4964cefce8bdab093cd 100644 (file)
@@ -37,7 +37,8 @@ from test.support import (is_resource_enabled,
                           requires_legacy_unicode_capi, check_sanitizer)
 from test.support import (TestFailed,
                           run_with_locale, cpython_only,
-                          darwin_malloc_err_warning, is_emscripten)
+                          darwin_malloc_err_warning, is_emscripten,
+                          skip_on_s390x)
 from test.support.import_helper import import_fresh_module
 from test.support import threading_helper
 from test.support import warnings_helper
@@ -5654,6 +5655,9 @@ class CWhitebox(unittest.TestCase):
     @unittest.skipIf(check_sanitizer(address=True, memory=True),
                      "ASAN/MSAN sanitizer defaults to crashing "
                      "instead of returning NULL for malloc failure.")
+    # gh-114331: The test allocates 784 271 641 GiB and mimalloc does not fail
+    # to allocate it when using mimalloc on s390x.
+    @skip_on_s390x
     def test_maxcontext_exact_arith(self):
 
         # Make sure that exact operations do not raise MemoryError due