Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on big-endian systems #101

Closed
hosiet opened this issue Nov 29, 2024 · 2 comments · Fixed by #102
Closed

Test failure on big-endian systems #101

hosiet opened this issue Nov 29, 2024 · 2 comments · Fixed by #102

Comments

@hosiet
Copy link

hosiet commented Nov 29, 2024

With the rebuild of fscacher on Debian Unstable/Sid ( https://tracker.debian.org/pkg/fscacher ), the following test error via Debian autopkgtest is found on s390x architecture:

 45s autopkgtest [03:10:08]: test pybuild-autopkgtest: [-----------------------
 46s pybuild-autopkgtest
 46s I: pybuild base:311: cd /tmp/autopkgtest-lxc.w959byms/downtmp/autopkgtest_tmp/build; python3.12 -m pytest 
 47s ============================= test session starts ==============================
 47s platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
 47s rootdir: /tmp/autopkgtest-lxc.w959byms/downtmp/autopkgtest_tmp/build
 47s plugins: typeguard-4.4.1, cov-5.0.0, mock-3.14.0, rerunfailures-14.0
 47s collected 27 items
 47s 
 47s tests/test_cache.py ................s.....                               [ 81%]
 47s tests/test_util.py ...F.                                                 [100%]
 47s 
 47s =================================== FAILURES ===================================
 47s _______________________ test_xor_bytes[\x12\xab-4-&\xab] _______________________
 47s 
 47s b1 = b'\x12\xab', b2 = b'4', r = b'&\xab'
 47s 
 47s     @pytest.mark.parametrize(
 47s         "b1,b2,r",
 47s         [
 47s             (b"\x12", b"\x34", b"\x26"),
 47s             (b"\0\x12", b"\0\x34", b"\0\x26"),
 47s             (b"\x12\0", b"\x34\0", b"\x26\0"),
 47s             (b"\x12\xAB", b"\x34", b"\x26\xAB"),
 47s             (b"\x12\xAB", b"\x34\xCD", b"\x26\x66"),
 47s         ],
 47s     )
 47s     def test_xor_bytes(b1: bytes, b2: bytes, r: bytes) -> None:
 47s >       assert xor_bytes(b1, b2) == r
 47s E       AssertionError: assert b'\x12\x9f' == b'&\xab'
 47s E         
 47s E         At index 0 diff: b'\x12' != b'&'
 47s E         Use -v to get more diff
 47s 
 47s tests/test_util.py:16: AssertionError
 47s =========================== short test summary info ============================
 47s FAILED tests/test_util.py::test_xor_bytes[\x12\xab-4-&\xab] - AssertionError:...
 47s =================== 1 failed, 25 passed, 1 skipped in 0.59s ====================
 47s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest-lxc.w959byms/downtmp/autopkgtest_tmp/build; python3.12 -m pytest 
 47s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p 3.12 returned exit code 13
 47s make: *** [/tmp/LMVqFCDGDw/run:4: pybuild-autopkgtest] Error 25
 47s pybuild-autopkgtest: error: /tmp/LMVqFCDGDw/run pybuild-autopkgtest returned exit code 2
 47s autopkgtest [03:10:10]: test pybuild-autopkgtest: -----------------------]

To my understanding, it should be the xor_byte() function implicitly assuming the little-endian hardware architecture.

The raw test log can be found at https://ci.debian.net/packages/f/fscacher/testing/s390x/54726807/ .

Please let me know how you would like to have this issue fixed, such as skipping the test on big-endians or pushing an actual fix. Thanks!

@hosiet
Copy link
Author

hosiet commented Dec 31, 2024

Ping. Any updates on this one? I am not sure whether the current implementation of xor_bytes() is working as intended. If yes, we should be able to safely skip this test on big-endian systems.

@yarikoptic
Copy link
Member

Thank you @hosiet for the report and sorry for the delay. Hopefully

would address it. I tested on zelenka -- that test passes with the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants