1.99.6 tests fail on s390x - byteorder

Bug #1937162 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyspread
Unknown
Unknown
pyspread (Ubuntu)
Undecided
Unassigned

Bug Description

After fixing bug 1937058 it still is blocked as on s390x there are further fails around code that already tries to handle byteorder but seems to fail on big endian.
Example test log:
https://autopkgtest.ubuntu.com/results/autopkgtest-impish/impish/s390x/p/pyspread/20210721_122643_4cbff@/log.gz

pyspread/test/test_workflows.py ............... [100%]

=================================== FAILURES ===================================
__________________________________ test_RGB32 __________________________________

    def test_RGB32():
        qimg = QtGui.QImage(320, 240, QtGui.QImage.Format_RGB32)
        qimg.fill(0)
        v = _qimageview(qimg)
        qimg.fill(23)
        qimg.setPixel(12, 10, QtGui.qRgb(0x12, 0x34, 0x56))
        assert_equal(v.shape, (240, 320))
        assert_equal(v[10, 10], 23 | 0xff000000)
> assert_equal(v[10, 12], 0xff123456
                     if sys.byteorder == 'little' else 0x563412ff)

pyspread/lib/test/test_qimageview.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 4279383126, b = 1446253311

    def assert_equal(a, b):
> assert a == b
E assert 4279383126 == 1446253311

pyspread/lib/test/test_qimageview.py:72: AssertionError
_________________________________ test_ARGB32 __________________________________

    def test_ARGB32():
        qimg = QtGui.QImage(320, 240, QtGui.QImage.Format_ARGB32)
        qimg.fill(0)
        v = _qimageview(qimg)
        qimg.setPixel(12, 10, QtGui.qRgb(0x12, 0x34, 0x56))
        assert_equal(v.shape, (240, 320))
> assert_equal(v[10, 12], 0xff123456
                     if sys.byteorder == 'little' else 0x563412ff)

pyspread/lib/test/test_qimageview.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 4279383126, b = 1446253311

    def assert_equal(a, b):
> assert a == b
E assert 4279383126 == 1446253311

tags: added: update-excuse
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Reproducible on s390x via:

$ apt install python3-matplotlib python3-numpy python3-pyqt5 python3-pyqt5.qtsvg python3-pytest python3-pytest-xvfb python3-setuptools
$ apt build-dep pyspread
$ cd pyspread-1.99.6/pyspread
$ py.test-3 lib/test/test_qimageview.py

It expects
 0xff123456
or on big endian
 0x563412ff
That is like a full reversed number.

But we get actually what is expected on non big endian.
E assert 4279383126 == 1446253311

And 4279383126 == 0xff123456

So the byte swap seems to be handled elsewhere and here it does NOT come up big-endianized.

If that is a test that was mistakenly made too big endian ready OR if there is an underlying issue that needs to be fixed - I don't know.
I'll fix the test in some Ubuntu delta for now (it does not seem to be a regression, but a new test coverage that was missing before) and report it upstream for a long term resolution.

Changed in pyspread (Ubuntu):
status: New → Triaged
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Reported upstream in
  https://gitlab.com/pyspread/pyspread/-/issues/93
And I have fixed the test until we know if there is something deeper to fix that seems to be the best option since it
a) does not seem to be a regression to before (1.99.5 didn't have the test but seems to behave the same)
b) retains all the rest of the test coverage
c) gets the new version migrating

I didn't report it to Debian yet as I can't be sure enough without an upstream response if the fix will be ok for the late freeze. Impish can pick up whatever upstream decides later on this cycle.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote (last edit ):

While not worth a report on its own as an FYI I added it to the other known FTFBS debian bug at:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986488

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pyspread - 1.99.6-1ubuntu2

---------------
pyspread (1.99.6-1ubuntu2) impish; urgency=medium

  * d/p/p-1937162-fix-big-endian-test.patch: fix tests on s390x (LP: #1937162)

pyspread (1.99.6-1ubuntu1) impish; urgency=medium

  * d/p/lp-1937058-Issue-92-Test-fix-test_on_font-to-tolerate-font-alia.patch:
    fix broken test in 1.99.6 (LP: #1937058)

 -- Christian Ehrhardt <email address hidden> Thu, 22 Jul 2021 08:06:26 +0200

Changed in pyspread (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.