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_wave: failures on PPC64 buildbot #63832

Closed
vstinner opened this issue Nov 17, 2013 · 11 comments
Closed

test_wave: failures on PPC64 buildbot #63832

vstinner opened this issue Nov 17, 2013 · 11 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

BPO 19633
Nosy @vstinner, @serhiy-storchaka
Files
  • wave_byteswap.patch
  • wave_byteswap_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-11-21.15:21:08.012>
    created_at = <Date 2013-11-17.22:26:57.022>
    labels = ['type-bug', 'library']
    title = 'test_wave: failures on PPC64 buildbot'
    updated_at = <Date 2013-11-21.15:21:08.010>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-11-21.15:21:08.010>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-11-21.15:21:08.012>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2013-11-17.22:26:57.022>
    creator = 'vstinner'
    dependencies = []
    files = ['32674', '32680']
    hgrepos = []
    issue_num = 19633
    keywords = ['patch']
    message_count = 11.0
    messages = ['203217', '203227', '203229', '203251', '203252', '203254', '203257', '203272', '203444', '203590', '203638']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'python-dev', 'serhiy.storchaka', 'David.Edelsohn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19633'
    versions = ['Python 3.4']

    @vstinner
    Copy link
    Member Author

    Some test_wave are failing, but only on PPC64 (big endian, right?).

    It may be related to issue bpo-1575020.

    http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.x/builds/1099/steps/test/logs/stdio

    ======================================================================
    ERROR: test_unseekable_incompleted_write (test.test_wave.WavePCM16Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 243, in test_unseekable_incompleted_write
        self.check_file(testfile, self.nframes + 1, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 84, in check_file
        self.assertEqual(f.readframes(nframes), frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/wave.py", line 257, in readframes
        data.fromfile(chunk.file.file, nitems)
    EOFError: read() didn't return enough bytes

    ======================================================================
    ERROR: test_unseekable_incompleted_write (test.test_wave.WavePCM32Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 243, in test_unseekable_incompleted_write
        self.check_file(testfile, self.nframes + 1, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 84, in check_file
        self.assertEqual(f.readframes(nframes), frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/wave.py", line 257, in readframes
        data.fromfile(chunk.file.file, nitems)
    EOFError: read() didn't return enough bytes

    ======================================================================
    FAIL: test_write_array (test.test_wave.WavePCM16Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 163, in test_write_array
        self.check_file(TESTFN, self.nframes, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
        self.assertEqual(f.getnframes(), nframes)
    AssertionError: 96 != 48

    ======================================================================
    FAIL: test_write_memoryview (test.test_wave.WavePCM16Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 171, in test_write_memoryview
        self.check_file(TESTFN, self.nframes, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
        self.assertEqual(f.getnframes(), nframes)
    AssertionError: 96 != 48

    ======================================================================
    FAIL: test_write_array (test.test_wave.WavePCM32Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 163, in test_write_array
        self.check_file(TESTFN, self.nframes, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
        self.assertEqual(f.getnframes(), nframes)
    AssertionError: 192 != 48

    ======================================================================
    FAIL: test_write_memoryview (test.test_wave.WavePCM32Test)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 171, in test_write_memoryview
        self.check_file(TESTFN, self.nframes, self.frames)
      File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
        self.assertEqual(f.getnframes(), nframes)
    AssertionError: 192 != 48

    @vstinner vstinner added the tests Tests in the Lib/test dir label Nov 17, 2013
    @serhiy-storchaka
    Copy link
    Member

    Thank you for your report.

    This patch should fix the issue.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error and removed tests Tests in the Lib/test dir labels Nov 17, 2013
    @vstinner
    Copy link
    Member Author

    • a = array.array('h', data)
      + a = array.array('h')
      + a.frombytes(data)

    I don't understand why it would change anything. According to the doc, passing data to the construction is like calling array.frombytes():
    http://docs.python.org/dev/library/array.html#array.array

    If it behaves differently, it looks like a bug a in the array module. Am I wrong?

    @serhiy-storchaka
    Copy link
    Member

    array's constructor interprets its second memoryview argument as an iterable of integers.

    >>> import array
    >>> array.array('h', b'abcd')
    array('h', [25185, 25699])
    >>> array.array('h', memoryview(b'abcd'))
    array('h', [97, 98, 99, 100])

    array.frombytes() always interpret its argument as bytes-like object.

    >>> a = array.array('h')
    >>> a.frombytes(memoryview(b'abcd'))
    >>> a
    array('h', [25185, 25699])

    First patch fixes only a half of the issue. test_unseekable_incompleted_write() still failed because array.fromfile() fails read incomplete data. Second patch also adds unittest.expectedFailure decorators for these tests.

    @vstinner
    Copy link
    Member Author

    array's constructor interprets its second memoryview argument as an iterable of integers.

    Ok so, so your fix is correct.

    First patch fixes only a half of the issue. test_unseekable_incompleted_write() still failed because array.fromfile() fails read incomplete data.

    Why the test succeeded on little endian?

    @serhiy-storchaka
    Copy link
    Member

    Why the test succeeded on little endian?

    Because array.fromfile() is used only to swap 16- and 32-bit samples on bigendian platform.

    Perhaps we need the byteswap() function in the audioop module.

    @vstinner
    Copy link
    Member Author

    Because array.fromfile() is used only to swap 16- and 32-bit samples on bigendian platform.

    If the file is truncated, why would the test suceed on little endian? The file doesn't have the same size in bytes? The test doesn't check the number of frames?

    @serhiy-storchaka
    Copy link
    Member

    If the file is truncated, why would the test suceed on little endian? The
    file doesn't have the same size in bytes? The test doesn't check the number
    of frames?

    Because this code is not used on little endian. On little endian a data is
    read by file's read() method.

    @DavidEdelsohn
    Copy link
    Mannequin

    DavidEdelsohn mannequin commented Nov 19, 2013

    By the way, test_wave also fails on zLinux, which also is Big Endian.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 21, 2013

    New changeset 7b040bc289e8 by Serhiy Storchaka in branch '3.3':
    Issue bpo-19633: Fixed writing not compressed 16- and 32-bit wave files on
    http://hg.python.org/cpython/rev/7b040bc289e8

    New changeset 7cf7f19445ba by Serhiy Storchaka in branch 'default':
    Issue bpo-19633: Fixed writing not compressed 16- and 32-bit wave files on
    http://hg.python.org/cpython/rev/7cf7f19445ba

    New changeset 03a32ead9c7d by Serhiy Storchaka in branch '2.7':
    Issue bpo-19633: Fixed writing not compressed 16- and 32-bit wave files on
    http://hg.python.org/cpython/rev/03a32ead9c7d

    @vstinner
    Copy link
    Member Author

    "PPC64 PowerLinux 3.x" buildbot is green again! I'm closing the issue. I didn't check 2.7 and 3.3 buildbots.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants