Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:GA
python3.35765
bpo-46623-skip-zlib-s390x.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bpo-46623-skip-zlib-s390x.patch of Package python3.35765
From 95e531321641a48151e69ff983ce67b967d7b677 Mon Sep 17 00:00:00 2001 From: Victor Stinner <vstinner@python.org> Date: Thu, 3 Feb 2022 09:42:07 +0100 Subject: [PATCH] skip two test_zlib tests failing on s390x Skip test_pair() and test_speech128() of test_zlib on s390x since they fail if zlib uses the s390x hardware accelerator. Code is originally from gh#python/cpython!31096, it was released upstream in 3.11.0. Fixes: gh#90781 Fixes: bpo-46623 Patch: bpo-46623-skip-zlib-s390x.patch --- Lib/test/test_zlib.py | 34 +++++++++++++++++++ .../2022-02-03-09-45-26.bpo-46623.vxzuhV.rst | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2022-02-03-09-45-26.bpo-46623.vxzuhV.rst diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index b7170b4ff52..4331793e233 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -1,6 +1,7 @@ import unittest from test import support import binascii +import os import pickle import random import sys @@ -15,6 +16,37 @@ requires_Decompress_copy = unittest.skipUnless( hasattr(zlib.decompressobj(), "copy"), 'requires Decompress.copy()') +# bpo-46623: On s390x, when a hardware accelerator is used, using different +# ways to compress data with zlib can produce different compressed data. +# Simplified test_pair() code: +# +# def func1(data): +# return zlib.compress(data) +# +# def func2(data) +# co = zlib.compressobj() +# x1 = co.compress(data) +# x2 = co.flush() +# return x1 + x2 +# +# On s390x if zlib uses a hardware accelerator, func1() creates a single +# "final" compressed block whereas func2() produces 3 compressed blocks (the +# last one is a final block). On other platforms with no accelerator, func1() +# and func2() produce the same compressed data made of a single (final) +# compressed block. +# +# Only the compressed data is different, the decompression returns the original +# data: +# +# zlib.decompress(func1(data)) == zlib.decompress(func2(data)) == data +# +# Make the assumption that s390x always has an accelerator to simplify the skip +# condition. Windows doesn't have os.uname() but it doesn't support s390x. +skip_on_s390x = unittest.skipIf( + hasattr(os, 'uname') and + os.uname().machine in ['s390x', 's390'], + 'skipped on s390x') + class VersionTestCase(unittest.TestCase): @@ -174,6 +206,7 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase): bufsize=zlib.DEF_BUF_SIZE), HAMLET_SCENE) + @skip_on_s390x def test_speech128(self): # compress more data data = HAMLET_SCENE * 128 @@ -225,6 +258,7 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase): class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase): # Test compression object + @skip_on_s390x def test_pair(self): # straightforward compress/decompress objects datasrc = HAMLET_SCENE * 128 diff --git a/Misc/NEWS.d/next/Tests/2022-02-03-09-45-26.bpo-46623.vxzuhV.rst b/Misc/NEWS.d/next/Tests/2022-02-03-09-45-26.bpo-46623.vxzuhV.rst new file mode 100644 index 00000000000..be085c067a3 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-02-03-09-45-26.bpo-46623.vxzuhV.rst @@ -0,0 +1,2 @@ +Skip test_pair() and test_speech128() of test_zlib on s390x since they fail +if zlib uses the s390x hardware accelerator. Patch by Victor Stinner. -- 2.45.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor