Your message dated Sun, 27 Apr 2025 23:34:01 +0000
with message-id <e1u9bvz-000xge...@fasolo.debian.org>
and subject line Bug#1104240: fixed in json-tricks 3.17.3-2
has caused the Debian Bug report #1104240,
regarding json-tricks: test failure (and FTBFS) on s390x
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1104240: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104240
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: json-tricks
Version: 3.17.3-1
Severity: serious
Tags: patch ftbfs
X-Debbugs-CC: cjwat...@debian.org, debian-s...@lists.debian.org

Hi,

json-tricks currently is blocked from migration to testing, see #1101381. This is because its autopkgtests fail on s390x. Indeed, trying a build of json-tricks on s390x also shows a FTBFS.

The embedded data in test_np.py assumes the tests are running on systems where the native arch is little-endian. Obviously thats wrong on s390x.

Just to reiterate, the test failures are as follows:

 35s =================================== FAILURES 
===================================
 35s ____________________ test_decode_compact_mixed_compactness 
_____________________
35s 35s def test_decode_compact_mixed_compactness():
 35s            json = '[{"__ndarray__": 
"b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAA' \
 35s                    'UQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQA==", "dtype": "float64", 
"shape": [2, 4], "Corder": ' \
 35s                    'true}, {"__ndarray__": [3.141592653589793, 2.718281828459045], "dtype": 
"float64", "shape": [2]}]'
 35s            data = loads(json)
 35s >       assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 
8.0]]), array([pi, exp(1)]))
35s E AssertionError: 35s E Arrays are not equal
 35s E    [3.14159265 2.71828183]
 35s E    Mismatched elements: 8 / 8 (100%)
 35s E    Max absolute difference among violations: 8.
 35s E    Max relative difference among violations: 1.
 35s E     ACTUAL: array([[3.03865e-319, 3.16202e-322, 1.04347e-320, 
2.05531e-320],
 35s E           [2.56124e-320, 3.06716e-320, 3.57308e-320, 4.07901e-320]])
 35s E     DESIRED: array([[1., 2., 3., 4.],
 35s E           [5., 6., 7., 8.]])
35s 35s tests/test_np.py:316: AssertionError
 35s ____________________ test_decode_compact_inline_compression 
____________________
35s 35s def test_decode_compact_inline_compression():
 35s            json = '[{"__ndarray__": 
"b64.gz:H4sIAAAAAAAC/2NgAIEP9gwQ4AChOKC0AJQWgdISUFoGSitAaSUorQKl1aC0BpTWgtI6UFoPShs4AABmfqWAgAAAAA==", "dtype": 
"float64", "shape": [4, 4], "Corder": true}]'
 35s            data = loads(json)
 35s >       assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 
8.0], [9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0]]))
35s E AssertionError: 35s E Arrays are not equal 35s E 35s E Mismatched elements: 16 / 16 (100%)
 35s E    Max absolute difference among violations: 16.
 35s E    Max relative difference among violations: 1.
 35s E     ACTUAL: array([[3.03865e-319, 3.16202e-322, 1.04347e-320, 
2.05531e-320],
 35s E           [2.56124e-320, 3.06716e-320, 3.57308e-320, 4.07901e-320],
 35s E           [4.33197e-320, 4.58493e-320, 4.83789e-320, 5.09085e-320],
 35s E           [5.34381e-320, 5.59678e-320, 5.84974e-320, 6.10270e-320]])
 35s E     DESIRED: array([[ 1.,  2.,  3.,  4.],
 35s E           [ 5.,  6.,  7.,  8.],
 35s E           [ 9., 10., 11., 12.],
 35s E           [13., 14., 15., 16.]])
35s 35s tests/test_np.py:348: AssertionError
 35s __________________ test_decode_compact_no_inline_compression 
___________________
35s 35s def test_decode_compact_no_inline_compression():
 35s            json = '[{"__ndarray__": 
"b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEA=", ' \
 35s                    '"dtype": "float64", "shape": [2, 2], "Corder": true}]'
 35s            data = loads(json)
 35s >       assert_equal(data[0], array([[1.0, 2.0], [3.0, 4.0]]))
35s E AssertionError: 35s E Arrays are not equal 35s E 35s E Mismatched elements: 4 / 4 (100%)
 35s E    Max absolute difference among violations: 4.
 35s E    Max relative difference among violations: 1.
 35s E     ACTUAL: array([[3.03865e-319, 3.16202e-322],
 35s E           [1.04347e-320, 2.05531e-320]])
 35s E     DESIRED: array([[1., 2.],
 35s E           [3., 4.]])
35s 35s tests/test_np.py:355: AssertionError

Attached is a patch that can be dropped into debian/patches, which fixes the
FTBFS on s390x. TBH I have not tested the patch on non-s390x, but I assume
it should be fine on little-endian archs.

There are probably other ways of fixing this, but adding "endian": "little" to the test data seems straightforward.

Best,
Chris

From: Chris Hofstaedtler <z...@debian.org>

Test data assumes tests are running on little-endian systems, or at least
that the native endianness is little. Obviously this breaks on big-endian
systems like s390x. Make the assumption explicit by adding "endian": "little"
to the to-decoded test-data.

Fixes FTBFS and CI test failures on s390x.

--- json-tricks-3.17.3.orig/tests/test_np.py
+++ json-tricks-3.17.3/tests/test_np.py
@@ -310,7 +310,7 @@ def test_encode_compact_no_inline_compre
 
 def test_decode_compact_mixed_compactness():
        json = '[{"__ndarray__": 
"b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAA' \
-               'UQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQA==", "dtype": "float64", 
"shape": [2, 4], "Corder": ' \
+               'UQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQA==", "dtype": "float64", 
"shape": [2, 4], "endian": "little", "Corder": ' \
                'true}, {"__ndarray__": [3.141592653589793, 2.718281828459045], 
"dtype": "float64", "shape": [2]}]'
        data = loads(json)
        assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 
8.0]]), array([pi, exp(1)]))
@@ -343,14 +343,14 @@ def test_decode_without_endianness():
 
 
 def test_decode_compact_inline_compression():
-       json = '[{"__ndarray__": 
"b64.gz:H4sIAAAAAAAC/2NgAIEP9gwQ4AChOKC0AJQWgdISUFoGSitAaSUorQKl1aC0BpTWgtI6UFoPShs4AABmfqWAgAAAAA==",
 "dtype": "float64", "shape": [4, 4], "Corder": true}]'
+       json = '[{"__ndarray__": 
"b64.gz:H4sIAAAAAAAC/2NgAIEP9gwQ4AChOKC0AJQWgdISUFoGSitAaSUorQKl1aC0BpTWgtI6UFoPShs4AABmfqWAgAAAAA==",
 "dtype": "float64", "shape": [4, 4], "Corder": true, "endian": "little"}]'
        data = loads(json)
        assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 
8.0], [9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0]]))
 
 
 def test_decode_compact_no_inline_compression():
        json = '[{"__ndarray__": 
"b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEA=", ' \
-               '"dtype": "float64", "shape": [2, 2], "Corder": true}]'
+               '"dtype": "float64", "shape": [2, 2], "Corder": true, "endian": 
"little"}]'
        data = loads(json)
        assert_equal(data[0], array([[1.0, 2.0], [3.0, 4.0]]))
 

--- End Message ---
--- Begin Message ---
Source: json-tricks
Source-Version: 3.17.3-2
Done: Colin Watson <cjwat...@debian.org>

We believe that the bug you reported is fixed in the latest version of
json-tricks, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1104...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwat...@debian.org> (supplier of updated json-tricks package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 28 Apr 2025 00:14:30 +0100
Source: json-tricks
Architecture: source
Version: 3.17.3-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Changed-By: Colin Watson <cjwat...@debian.org>
Closes: 1104240
Changes:
 json-tricks (3.17.3-2) unstable; urgency=medium
 .
   * Team upload.
 .
   [ Chris Hofstaedtler ]
   * Fix test failures on big-endian systems (closes: #1104240).
Checksums-Sha1:
 94f5c16a0aad525ae7100669280465a41a4b00bc 2346 json-tricks_3.17.3-2.dsc
 99dfb42ade8f4dc80b9e4a6fbe3e74de183e771d 4768 
json-tricks_3.17.3-2.debian.tar.xz
Checksums-Sha256:
 f161e5c6ba58b7e3312760fb78a5682f1f932b4705432735d2181960933ecdd3 2346 
json-tricks_3.17.3-2.dsc
 a58d14832a97b6c9f242f75643c4ff58e1fc47fcfdf27e730e97724c3cb20c65 4768 
json-tricks_3.17.3-2.debian.tar.xz
Files:
 50fd534c1f68c89c0ee4287c335ff11a 2346 python optional json-tricks_3.17.3-2.dsc
 20cf1dbae5f42f6c11c36ce1567b58a1 4768 python optional 
json-tricks_3.17.3-2.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmgOunUACgkQOTWH2X2G
UAtlThAAkk7jBDha1TQYgW/xoaoYdtZ2NLfRVMfvrIIVHW5Ti8Vy2rPlXXCC5ABX
PhbvuYmd5DG+d1r5bFL1BbBYfDezWCAcgdssO1qi1FwY1HQ3FtEELgJoVryB/k16
aBf+Alo6x/GzYm/k3ngOh8sTy5u7lgMPq61zDqFjgoargtXVNA1leWDAE1lz3c69
IitITKwbBZTse5FMY3aZiyN0JeOcc/+YxnsWuB3Y3CU/6Ci7hvNwfx4aMRjldoLX
+BNiNk+m1fnwTRKG5dYk6p8Nca5pIoIPawWnY5B3JyG0nEJaTmBxBPkozMm2LF88
xTzxxjD9RDpczMzTKQFgMD9u7KBhnv6hgzAYoYL5MHflW5Kko14AnoIAUdm8gPD0
t/EEmAcSA+3alSJDo9EyV6QLvGsTzi+v44yiTmkCh/DfQh5leVrs07eshxHEm3D0
K33MHM67e7wbhl9kS+2I1HMNSAqJNnSGWP6dXM5NytMSiYSHewdK9n055Nuq2WnH
RRRsbnwY0iZe7zvRbFm1MegxcC8zafF7iQatx9pCWC/dPERhKrdLcvfRgXddhk9W
RaCpme2ZddvuJPB1PoXHBdqE2vuZ+ObbNSWnvf4BBtc8PnUbfMmvzjfUfBPbwtsQ
Yz7iHU2boFKJuF4UlpB4oqJ7RbT2fLLi4sJLwznazOUKwWfYhTM=
=UEBD
-----END PGP SIGNATURE-----

Attachment: pgpw82dN5NNSS.pgp
Description: PGP signature


--- End Message ---

Reply via email to