Skip to content

TestSuite.test_psnr fails on s390x #546

Closed
@musicinmybrain

Description

@musicinmybrain

On s390x, TestSuite.test_psnr fails:

=================================== FAILURES ===================================
_____________________________ TestSuite.test_psnr ______________________________
self = <tests.test_tiff2jp2.TestSuite testMethod=test_psnr>
    def test_psnr(self):
        """
        SCENARIO:  Convert TIFF file to JP2 with the irreversible transform.
    
        EXPECTED RESULT:  data matches, the irreversible transform is confirmed
        """
        with Tiff2Jp2k(
            self.minisblack_spp1_path, self.temp_jp2_filename,
            psnr=(30, 35, 40, 0)
        ) as j:
            j.run()
    
        j = Jp2k(self.temp_jp2_filename)
    
        d = {}
        for layer in range(4):
            j.layer = layer
            d[layer] = j[:]
    
        with warnings.catch_warnings():
            # MSE is zero for that first image, resulting in a divide-by-zero
            # warning
            warnings.simplefilter('ignore')
            psnr = [
                fixtures.skimage.metrics.peak_signal_noise_ratio(
                    fixtures.skimage.data.moon(), d[j]
                )
                for j in range(4)
            ]
    
        # That first image should be lossless.
>       self.assertTrue(np.isinf(psnr[0]))
E       AssertionError: False is not true
tests/test_tiff2jp2.py:584: AssertionError
=========================== short test summary info ============================
FAILED tests/test_tiff2jp2.py::TestSuite::test_psnr - AssertionError: False i...
================== 1 failed, 528 passed, 4 skipped in 49.92s ===================

I haven’t yet investigated this closely enough to form a theory about what is going wrong on this platform.

Since s390x is the only big-endian primary architecture in Fedora Linux, this bug could be endian-related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions