Skip to content

Commit 8bbb121

Browse files
authored
[3.11] gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326) (#117331)
gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326) Add test.support.skip_on_s390x decorator. (cherry picked from commit 6702d2b)
1 parent 65a0923 commit 8bbb121

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"run_with_tz", "PGO", "missing_compiler_executable",
5757
"ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST",
5858
"LOOPBACK_TIMEOUT", "INTERNET_TIMEOUT", "SHORT_TIMEOUT", "LONG_TIMEOUT",
59+
"skip_on_s390x",
5960
]
6061

6162

@@ -2238,3 +2239,7 @@ def copy_python_src_ignore(path, names):
22382239
'build',
22392240
}
22402241
return ignored
2242+
2243+
#Windows doesn't have os.uname() but it doesn't support s390x.
2244+
skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x',
2245+
'skipped on s390x')

Lib/test/test_decimal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
requires_legacy_unicode_capi, check_sanitizer)
3838
from test.support import (TestFailed,
3939
run_with_locale, cpython_only,
40-
darwin_malloc_err_warning, is_emscripten)
40+
darwin_malloc_err_warning, is_emscripten,
41+
skip_on_s390x)
4142
from test.support.import_helper import import_fresh_module
4243
from test.support import threading_helper
4344
from test.support import warnings_helper
@@ -5654,6 +5655,9 @@ def __abs__(self):
56545655
@unittest.skipIf(check_sanitizer(address=True, memory=True),
56555656
"ASAN/MSAN sanitizer defaults to crashing "
56565657
"instead of returning NULL for malloc failure.")
5658+
# gh-114331: The test allocates 784 271 641 GiB and mimalloc does not fail
5659+
# to allocate it when using mimalloc on s390x.
5660+
@skip_on_s390x
56575661
def test_maxcontext_exact_arith(self):
56585662

56595663
# Make sure that exact operations do not raise MemoryError due

0 commit comments

Comments
 (0)