Skip to content

Commit

Permalink
[3.11] pythongh-114331: Skip decimal test_maxcontext_exact_arith on s…
Browse files Browse the repository at this point in the history
…390x (python#117326) (python#117331)

pythongh-114331: Skip decimal test_maxcontext_exact_arith on s390x (python#117326)

Add test.support.skip_on_s390x decorator.

(cherry picked from commit 6702d2b)
  • Loading branch information
vstinner authored Mar 28, 2024
1 parent 65a0923 commit 8bbb121
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"run_with_tz", "PGO", "missing_compiler_executable",
"ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST",
"LOOPBACK_TIMEOUT", "INTERNET_TIMEOUT", "SHORT_TIMEOUT", "LONG_TIMEOUT",
"skip_on_s390x",
]


Expand Down Expand Up @@ -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')
6 changes: 5 additions & 1 deletion Lib/test/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
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
Expand Down Expand Up @@ -5654,6 +5655,9 @@ def __abs__(self):
@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
Expand Down

0 comments on commit 8bbb121

Please sign in to comment.