Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 706570 - dev-python/pillow-7.0.0 fails 10 tests on ppc64
Summary: dev-python/pillow-7.0.0 fails 10 tests on ppc64
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2020-01-26 22:09 UTC by ernsteiswuerfel
Modified: 2021-03-01 19:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (pillow-7.0.0:20200126-215936.log,231.74 KB, text/plain)
2020-01-26 22:09 UTC, ernsteiswuerfel
Details
emerge --info (file_706570.txt,5.87 KB, text/plain)
2020-01-26 22:10 UTC, ernsteiswuerfel
Details
build.log (8.1.0, ppc64) (pillow-8.1.0:20210110-220828.log,348.74 KB, text/plain)
2021-01-10 22:23 UTC, ernsteiswuerfel
Details
emerge --info (file_706570.txt,6.01 KB, text/plain)
2021-01-10 22:24 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2020-01-26 22:09:51 UTC
Created attachment 605026 [details]
build.log

[...]
=============================================== FAILURES ===============================================
_________________________________ TestFileLibTiff.test_old_style_jpeg __________________________________

self = <Tests.test_file_libtiff.TestFileLibTiff testMethod=test_old_style_jpeg>

    def test_old_style_jpeg(self):
        infile = "Tests/images/old-style-jpeg-compression.tif"
        with Image.open(infile) as im:
            self.assert_image_equal_tofile(
>               im, "Tests/images/old-style-jpeg-compression.png"
            )

Tests/test_file_libtiff.py:806: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:124: in assert_image_equal_tofile
    self.assert_image_equal(a, img, msg)
Tests/helper.py:118: in assert_image_equal
    self.fail(msg or "got different content")
E   AssertionError: got different content
__________________________ TestFileLibTiff.test_strip_ycbcr_jpeg_1x1_sampling __________________________

self = <Tests.test_file_libtiff.TestFileLibTiff testMethod=test_strip_ycbcr_jpeg_1x1_sampling>

    def test_strip_ycbcr_jpeg_1x1_sampling(self):
        infile = "Tests/images/tiff_strip_ycbcr_jpeg_1x1_sampling.tif"
        with Image.open(infile) as im:
>           self.assert_image_equal_tofile(im, "Tests/images/flower2.jpg")

Tests/test_file_libtiff.py:783: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:124: in assert_image_equal_tofile
    self.assert_image_equal(a, img, msg)
Tests/helper.py:118: in assert_image_equal
    self.fail(msg or "got different content")
E   AssertionError: got different content
__________________________ TestFileLibTiff.test_strip_ycbcr_jpeg_2x2_sampling __________________________

self = <Tests.test_file_libtiff.TestFileLibTiff testMethod=test_strip_ycbcr_jpeg_2x2_sampling>

    def test_strip_ycbcr_jpeg_2x2_sampling(self):
        infile = "Tests/images/tiff_strip_ycbcr_jpeg_2x2_sampling.tif"
        with Image.open(infile) as im:
>           self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 0.5)

Tests/test_file_libtiff.py:778: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:164: in assert_image_similar_tofile
    self.assert_image_similar(a, img, epsilon, msg)
Tests/helper.py:158: in assert_image_similar
    raise e
Tests/helper.py:149: in assert_image_similar
    % (ave_diff, epsilon),
E   AssertionError: 0.5 not greater than or equal to 214.47257523148147 :  average pixel value difference 214.4726 > epsilon 0.5000
__________________________ TestFileLibTiff.test_tiled_ycbcr_jpeg_1x1_sampling __________________________

self = <Tests.test_file_libtiff.TestFileLibTiff testMethod=test_tiled_ycbcr_jpeg_1x1_sampling>

    def test_tiled_ycbcr_jpeg_1x1_sampling(self):
        infile = "Tests/images/tiff_tiled_ycbcr_jpeg_1x1_sampling.tif"
        with Image.open(infile) as im:
>           self.assert_image_equal_tofile(im, "Tests/images/flower2.jpg")

Tests/test_file_libtiff.py:795: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:124: in assert_image_equal_tofile
    self.assert_image_equal(a, img, msg)
Tests/helper.py:118: in assert_image_equal
    self.fail(msg or "got different content")
E   AssertionError: got different content
__________________________ TestFileLibTiff.test_tiled_ycbcr_jpeg_2x2_sampling __________________________

self = <Tests.test_file_libtiff.TestFileLibTiff testMethod=test_tiled_ycbcr_jpeg_2x2_sampling>

    def test_tiled_ycbcr_jpeg_2x2_sampling(self):
        infile = "Tests/images/tiff_tiled_ycbcr_jpeg_2x2_sampling.tif"
        with Image.open(infile) as im:
>           self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 0.5)

Tests/test_file_libtiff.py:800: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:164: in assert_image_similar_tofile
    self.assert_image_similar(a, img, epsilon, msg)
Tests/helper.py:158: in assert_image_similar
    raise e
Tests/helper.py:149: in assert_image_similar
    % (ave_diff, epsilon),
E   AssertionError: 0.5 not greater than or equal to 214.44628472222223 :  average pixel value difference 214.4463 > epsilon 0.5000
_______________________________________ TestFilePng.test_sanity ________________________________________

self = <Tests.test_file_png.TestFilePng testMethod=test_sanity>

    def test_sanity(self):
    
        # internal version number
        self.assertRegex(Image.core.zlib_version, r"\d+\.\d+\.\d+(\.\d+)?$")
    
        test_file = self.tempfile("temp.png")
    
        hopper("RGB").save(test_file)
    
        with Image.open(test_file) as im:
            im.load()
            self.assertEqual(im.mode, "RGB")
            self.assertEqual(im.size, (128, 128))
            self.assertEqual(im.format, "PNG")
            self.assertEqual(im.get_format_mimetype(), "image/png")
    
        for mode in ["1", "L", "P", "RGB", "I", "I;16"]:
            im = hopper(mode)
            im.save(test_file)
            with Image.open(test_file) as reloaded:
                if mode == "I;16":
                    reloaded = reloaded.convert(mode)
>               self.assert_image_equal(reloaded, im)

Tests/test_file_png.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:118: in assert_image_equal
    self.fail(msg or "got different content")
E   AssertionError: got different content
_____________________________ TestFileWebpAnimation.test_write_animation_L _____________________________

self = <Tests.test_file_webp_animated.TestFileWebpAnimation testMethod=test_write_animation_L>

    def test_write_animation_L(self):
        """
        Convert an animated GIF to animated WebP, then compare the
        frame count, and first and last frames to ensure they're
        visually similar.
        """
    
        with Image.open("Tests/images/iss634.gif") as orig:
            self.assertGreater(orig.n_frames, 1)
    
            temp_file = self.tempfile("temp.webp")
            orig.save(temp_file, save_all=True)
            with Image.open(temp_file) as im:
                self.assertEqual(im.n_frames, orig.n_frames)
    
                # Compare first and last frames to the original animated GIF
                orig.load()
                im.load()
                self.assert_image_similar(im, orig.convert("RGBA"), 25.0)
                orig.seek(orig.n_frames - 1)
                im.seek(im.n_frames - 1)
                orig.load()
                im.load()
>               self.assert_image_similar(im, orig.convert("RGBA"), 25.0)

Tests/test_file_webp_animated.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:158: in assert_image_similar
    raise e
Tests/helper.py:149: in assert_image_similar
    % (ave_diff, epsilon),
E   AssertionError: 25.0 not greater than or equal to 57.66992086630571 :  average pixel value difference 57.6699 > epsilon 25.0000
____________________________ TestFileWebpAnimation.test_write_animation_RGB ____________________________

self = <Tests.test_file_webp_animated.TestFileWebpAnimation testMethod=test_write_animation_RGB>

    def test_write_animation_RGB(self):
        """
        Write an animated WebP from RGB frames, and ensure the frames
        are visually similar to the originals.
        """
    
        def check(temp_file):
            with Image.open(temp_file) as im:
                self.assertEqual(im.n_frames, 2)
    
                # Compare first frame to original
                im.load()
                self.assert_image_equal(im, frame1.convert("RGBA"))
    
                # Compare second frame to original
                im.seek(1)
                im.load()
                self.assert_image_equal(im, frame2.convert("RGBA"))
    
        with Image.open("Tests/images/anim_frame1.webp") as frame1:
            with Image.open("Tests/images/anim_frame2.webp") as frame2:
                temp_file1 = self.tempfile("temp.webp")
                frame1.copy().save(
                    temp_file1, save_all=True, append_images=[frame2], lossless=True
                )
>               check(temp_file1)

Tests/test_file_webp_animated.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/test_file_webp_animated.py:81: in check
    self.assert_image_equal(im, frame2.convert("RGBA"))
Tests/helper.py:118: in assert_image_equal
    self.fail(msg or "got different content")
E   AssertionError: got different content
___________________________________ TestImageGetExtrema.test_extrema ___________________________________

self = <Tests.test_image_getextrema.TestImageGetExtrema testMethod=test_extrema>

    def test_extrema(self):
        def extrema(mode):
            return hopper(mode).getextrema()
    
        self.assertEqual(extrema("1"), (0, 255))
        self.assertEqual(extrema("L"), (1, 255))
        self.assertEqual(extrema("I"), (1, 255))
        self.assertEqual(extrema("F"), (1, 255))
        self.assertEqual(extrema("P"), (0, 225))  # fixed palette
        self.assertEqual(extrema("RGB"), ((0, 255), (0, 255), (0, 255)))
        self.assertEqual(extrema("RGBA"), ((0, 255), (0, 255), (0, 255), (255, 255)))
        self.assertEqual(extrema("CMYK"), ((0, 255), (0, 255), (0, 255), (0, 0)))
>       self.assertEqual(extrema("I;16"), (1, 255))
E       AssertionError: Tuples differ: (256, 65280) != (1, 255)
E       
E       First differing element 0:
E       256
E       1
E       
E       - (256, 65280)
E       + (1, 255)

Tests/test_image_getextrema.py:19: AssertionError
___________________________________ TestImageGetExtrema.test_true_16 ___________________________________

self = <Tests.test_image_getextrema.TestImageGetExtrema testMethod=test_true_16>

    def test_true_16(self):
        with Image.open("Tests/images/16_bit_noise.tif") as im:
            self.assertEqual(im.mode, "I;16")
            extrema = im.getextrema()
>       self.assertEqual(extrema, (106, 285))
E       AssertionError: Tuples differ: (513, 64512) != (106, 285)
E       
E       First differing element 0:
E       513
E       106
E       
E       - (513, 64512)
E       + (106, 285)

Tests/test_image_getextrema.py:25: AssertionError
======================================= short test summary info
[...]
========================= 10 failed, 1285 passed, 132 skipped in 85.24 seconds =========================
 * ERROR: dev-python/pillow-7.0.0::gentoo failed (test phase):
 *   Tests fail with python3.6
Comment 1 ernsteiswuerfel archtester 2020-01-26 22:10:58 UTC
Created attachment 605030 [details]
emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-07-14 22:24:21 UTC
Mentioned the failures which happen on ppc64 (big endian) with 7.2.0 here: https://github.com/python-pillow/Pillow/issues/3243#issuecomment-658442427.
Comment 3 ernsteiswuerfel archtester 2021-01-10 22:23:24 UTC
Created attachment 682312 [details]
build.log (8.1.0, ppc64)

8.1.0 certainly looks a better than 7.0.0, only 1 (2?) test failures instead of 10:

[...]
=============================================== FAILURES ===============================================
______________________________________________ test_cmyk _______________________________________________

    @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
    def test_cmyk():
        with Image.open("Tests/images/pil_sample_cmyk.eps") as cmyk_image:
    
            assert cmyk_image.mode == "CMYK"
            assert cmyk_image.size == (100, 100)
            assert cmyk_image.format == "EPS"
    
            cmyk_image.load()
            assert cmyk_image.mode == "RGB"
    
            if features.check("jpg"):
                with Image.open("Tests/images/pil_sample_rgb.jpg") as target:
>                   assert_image_similar(cmyk_image, target, 10)

Tests/test_file_eps.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Tests/helper.py:134: in assert_image_similar
    raise e
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = <PIL.EpsImagePlugin.EpsImageFile image mode=RGB size=100x100 at 0x3FFF93D8EFD0>
b = <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=100x100 at 0x3FFF9371E250>, epsilon = 10
msg = None

    def assert_image_similar(a, b, epsilon, msg=None):
        assert a.mode == b.mode, msg or f"got mode {repr(a.mode)}, expected {repr(b.mode)}"
        assert a.size == b.size, msg or f"got size {repr(a.size)}, expected {repr(b.size)}"
    
        a, b = convert_to_comparable(a, b)
    
        diff = 0
        for ach, bch in zip(a.split(), b.split()):
            chdiff = ImageMath.eval("abs(a - b)", a=ach, b=bch).convert("L")
            diff += sum(i * num for i, num in enumerate(chdiff.histogram()))
    
        ave_diff = diff / (a.size[0] * a.size[1])
        try:
>           assert epsilon >= ave_diff, (
                (msg or "")
                + f" average pixel value difference {ave_diff:.4f} > epsilon {epsilon:.4f}"
            )
E           AssertionError:  average pixel value difference 119.0294 > epsilon 10.0000
E           assert 10 >= 119.0294

Tests/helper.py:123: AssertionError
======================================= short test summary info ========================================
[...]
FAILED Tests/test_file_eps.py::test_cmyk - AssertionError:  average pixel value difference 119.0294 >...
======================= 1 failed, 1489 passed, 223 skipped, 11 xfailed in 45.91s =======================
 * ERROR: dev-python/pillow-8.1.0::gentoo failed (test phase):
Comment 4 ernsteiswuerfel archtester 2021-01-10 22:24:34 UTC
Created attachment 682315 [details]
emerge --info
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-01 19:00:38 UTC
Note that on ppc64 with 8.1.1, I only hit one failure (test_cmyk, bug 763309). So we can probably close this?