bpo-46623: Skip two test_zlib tests on s390x#31096
bpo-46623: Skip two test_zlib tests on s390x#31096vstinner merged 3 commits intopython:mainfrom vstinner:test_zlib
Conversation
Skip test_pair() and test_speech128() of test_zlib on s390x since they fail if zlib uses the s390x hardware accelerator.
|
The tests check round-trip as well as compression, though. |
| # | ||
| # Make the assumption that s390x always has an accelerator to simplify the | ||
| # skip condition. Don't skip on Windows which doesn't have os.uname(). | ||
| skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x', |
There was a problem hiding this comment.
To implementing Petr's comment suggestion:
| skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x', | |
| def not_s390x(): | |
| return not (hasattr(os, 'uname') and os.uname().machine == 's390x') |
and replace @skip...s below with if not_s390x: on asserts.
|
I got access to a s390x machine (RHEL8), sadly it didn't have the zlib hardware optimization and so test_zlib just passed. I agree that it's not ideal to always skip 2 tests on s390x. But the test is run on all other architectures and all other test_zlib tests are still run. An alternative would be to remove the tests which make too many assumptions about compressed data. For now, I prefer to just skip the tests. If someone knows how to detect the hardware accelerator or wants to enhance the tests, please go ahead and write a PR ;-) |
|
Even if Python 3.9 and 3.10 are also affected, I prefer to not backport the change since it's not ideal. |
Skip test_pair() and test_speech128() of test_zlib on s390x since they fail if zlib uses the s390x hardware accelerator.
…, skip checking the compressed bytes (pythonGH-125042) This backports two commits: - pythonGH-31096 skipped the tests unconditionally - pythonGH-125042 skips only the possibly-failing assertion (cherry picked from commit cc5a225)
…ration, skip checking the compressed bytes (pythonGH-125042) This backports two commits: - pythonGH-31096 skipped the tests unconditionally - pythonGH-125042 skips only the possibly-failing assertion (cherry picked from commit d522856) Co-authored-by: Petr Viktorin <[email protected]>
…p checking the compressed bytes (GH-125042) (#125585) gh-125041: gh-90781: test_zlib: For s390x HW acceleration, skip checking the compressed bytes (GH-125042) This backports two commits: - GH-31096 skipped the tests unconditionally - GH-125042 skips only the possibly-failing assertion (cherry picked from commit cc5a225)
Skip test_pair() and test_speech128() of test_zlib on s390x since
they fail if zlib uses the s390x hardware accelerator.
https://bugs.python.org/issue46623