Skip to content

test_bgzf.py failing on ARM64 #1696

Open

Description

@peterjc

Setup

Reported by @sagitter as part of #1693

Python 3.7.0rc1
GCC 8.1.1
Linux 4.18.0-0.rc1 fedora
Biopython 1.71

Expected behaviour

+ /usr/bin/python3 run_tests.py --offline -v test_bgzf.py
Skipping any tests requiring internet access
Python version: 3.7.0rc1 (v3.7.0rc1:dfad352267, Jun 12 2018, 01:00:10) 
[Clang 6.0 (clang-600.0.57)]
Operating system: posix darwin
test_bgzf ... ok
test_bam_ex1 (test_bgzf.BgzfTests)
Reproduce BGZF compression for BAM file ... ok
test_example_cor6 (test_bgzf.BgzfTests)
Reproduce BGZF compression for cor6_6.gb GenBank file ... ok
test_example_fastq (test_bgzf.BgzfTests)
Reproduce BGZF compression for a FASTQ file ... ok
test_example_gb (test_bgzf.BgzfTests)
Reproduce BGZF compression for NC_000932 GenBank file ... ok
test_example_wnts_xml (test_bgzf.BgzfTests)
Reproduce BGZF compression for wnts.xml BLAST file ... ok
test_iter_bam_ex1 (test_bgzf.BgzfTests)
Check iteration over SamBam/ex1.bam ... ok
test_iter_example_cor6 (test_bgzf.BgzfTests)
Check iteration over GenBank/cor6_6.gb.bgz ... ok
test_iter_example_fastq (test_bgzf.BgzfTests)
Check iteration over Quality/example.fastq.bgz ... ok
test_iter_example_gb (test_bgzf.BgzfTests)
Check iteration over GenBank/NC_000932.gb.bgz ... ok
test_iter_wnts_xml (test_bgzf.BgzfTests)
Check iteration over Blast/wnts.xml.bgz ... ok
test_random_bam_ex1 (test_bgzf.BgzfTests)
Check random access to SamBam/ex1.bam ... ok
test_random_bam_ex1_header (test_bgzf.BgzfTests)
Check random access to SamBam/ex1_header.bam ... ok
test_random_bam_ex1_refresh (test_bgzf.BgzfTests)
Check random access to SamBam/ex1_refresh.bam ... ok
test_random_example_cor6 (test_bgzf.BgzfTests)
Check random access to GenBank/cor6_6.gb.bgz ... ok
test_random_example_dos_fastq (test_bgzf.BgzfTests)
Check random access to Quality/example_dos.fastq.bgz (DOS newlines) ... ok
test_random_example_fastq (test_bgzf.BgzfTests)
Check random access to Quality/example.fastq.bgz (Unix newlines) ... ok
test_random_wnts_xml (test_bgzf.BgzfTests)
Check random access to Blast/wnts.xml.bgz ... ok
test_text_example_fastq (test_bgzf.BgzfTests)
Check text mode access to Quality/example.fastq.bgz ... ok
test_text_wnts_xml (test_bgzf.BgzfTests)
Check text mode access to Blast/wnts.xml.bgz ... ok
test_write_tell (test_bgzf.BgzfTests)
Check offset works during BGZF writing ... ok
----------------------------------------------------------------------
Ran 1 test in 3.681 seconds

Actual behaviour

e.g. https://kojipkgs.fedoraproject.org//work/tasks/9804/27769804/build.log

+ /usr/bin/python3 run_tests.py --offline -v test_bgzf.py
test_bgzf ... FAIL
test_bam_ex1 (test_bgzf.BgzfTests)
Reproduce BGZF compression for BAM file ... FAIL
test_example_cor6 (test_bgzf.BgzfTests)
Reproduce BGZF compression for cor6_6.gb GenBank file ... FAIL
test_example_fastq (test_bgzf.BgzfTests)
Reproduce BGZF compression for a FASTQ file ... ok
test_example_gb (test_bgzf.BgzfTests)
Reproduce BGZF compression for NC_000932 GenBank file ... FAIL
test_example_wnts_xml (test_bgzf.BgzfTests)
Reproduce BGZF compression for wnts.xml BLAST file ... FAIL
test_iter_bam_ex1 (test_bgzf.BgzfTests)
Check iteration over SamBam/ex1.bam ... ok
test_iter_example_cor6 (test_bgzf.BgzfTests)
Check iteration over GenBank/cor6_6.gb.bgz ... ok
test_iter_example_fastq (test_bgzf.BgzfTests)
Check iteration over Quality/example.fastq.bgz ... ok
test_iter_example_gb (test_bgzf.BgzfTests)
Check iteration over GenBank/NC_000932.gb.bgz ... ok
test_iter_wnts_xml (test_bgzf.BgzfTests)
Check iteration over Blast/wnts.xml.bgz ... ok
test_random_bam_ex1 (test_bgzf.BgzfTests)
Check random access to SamBam/ex1.bam ... ok
test_random_bam_ex1_header (test_bgzf.BgzfTests)
Check random access to SamBam/ex1_header.bam ... ok
test_random_bam_ex1_refresh (test_bgzf.BgzfTests)
Check random access to SamBam/ex1_refresh.bam ... ok
test_random_example_cor6 (test_bgzf.BgzfTests)
Check random access to GenBank/cor6_6.gb.bgz ... ok
test_random_example_dos_fastq (test_bgzf.BgzfTests)
Check random access to Quality/example_dos.fastq.bgz (DOS newlines) ... ok
test_random_example_fastq (test_bgzf.BgzfTests)
Check random access to Quality/example.fastq.bgz (Unix newlines) ... ok
test_random_wnts_xml (test_bgzf.BgzfTests)
Check random access to Blast/wnts.xml.bgz ... ok
test_text_example_fastq (test_bgzf.BgzfTests)
Check text mode access to Quality/example.fastq.bgz ... ok
test_text_wnts_xml (test_bgzf.BgzfTests)
Check text mode access to Blast/wnts.xml.bgz ... ok
test_write_tell (test_bgzf.BgzfTests)
Check offset works during BGZF writing ... ok
======================================================================
FAIL: test_bam_ex1 (test_bgzf.BgzfTests)
Reproduce BGZF compression for BAM file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 334, in test_bam_ex1
    self.check_blocks("SamBam/ex1.bam", temp_file)
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 85, in check_blocks
    self.assertEqual(old, new)
AssertionError: Lists differ: [(0, 18239, 0, 65536), (18239, 18223, 65536, 655[180 chars], 0)] != [(0, 18039, 0, 65536), (18039, 18064, 65536, 655[180 chars], 0)]
First differing element 0:
(0, 18239, 0, 65536)
(0, 18039, 0, 65536)
Diff is 778 characters long. Set self.maxDiff to None to see it.
======================================================================
FAIL: test_example_cor6 (test_bgzf.BgzfTests)
Reproduce BGZF compression for cor6_6.gb GenBank file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 356, in test_example_cor6
    self.check_blocks("GenBank/cor6_6.gb.bgz", temp_file)
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 85, in check_blocks
    self.assertEqual(old, new)
AssertionError: Lists differ: [(0, 4350, 0, 14967), (4350, 28, 14967, 0)] != [(0, 4348, 0, 14967), (4348, 28, 14967, 0)]
First differing element 0:
(0, 4350, 0, 14967)
(0, 4348, 0, 14967)
- [(0, 4350, 0, 14967), (4350, 28, 14967, 0)]
?        ^  ---            ^^
+ [(0, 4348, 0, 14967), (4348, 28, 14967, 0)]
?        ^^^^              ^^
======================================================================
FAIL: test_example_gb (test_bgzf.BgzfTests)
Reproduce BGZF compression for NC_000932 GenBank file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 350, in test_example_gb
    self.check_blocks("GenBank/NC_000932.gb.bgz", temp_file)
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 85, in check_blocks
    self.assertEqual(old, new)
AssertionError: Lists differ: [(0, 15073, 0, 65536), (15073, 17857, 65536, 65536[114 chars], 0)] != [(0, 15070, 0, 65536), (15070, 17829, 65536, 65536[114 chars], 0)]
First differing element 0:
(0, 15073, 0, 65536)
(0, 15070, 0, 65536)
- [(0, 15073, 0, 65536),
?          ---
+ [(0, 15070, 0, 65536),
?            +++
-  (15073, 17857, 65536, 65536),
?       ^     ^^
+  (15070, 17829, 65536, 65536),
?       ^     ^^
-  (32930, 22144, 131072, 65536),
?      ^^     ^^
+  (32899, 22161, 131072, 65536),
?     + ^     ^^
-  (55074, 22230, 196608, 65536),
?         -------
+  (55060, 22174, 196608, 65536),
?      +++++++
-  (77304, 14939, 262144, 43478),
?      -     ^^^
+  (77234, 14876, 262144, 43478),
?     +      ^^^
-  (92243, 28, 305622, 0)]
?     ^^^
+  (92110, 28, 305622, 0)]
?     ^^^
======================================================================
FAIL: test_example_wnts_xml (test_bgzf.BgzfTests)
Reproduce BGZF compression for wnts.xml BLAST file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 362, in test_example_wnts_xml
    self.check_blocks("Blast/wnts.xml.bgz", temp_file)
  File "/builddir/build/BUILD/python-biopython-1.71/python3/Tests/test_bgzf.py", line 85, in check_blocks
    self.assertEqual(old, new)
AssertionError: Lists differ: [(0, 5280, 0, 65536), (5280, 5477, 65536, 65536[171 chars], 0)] != [(0, 5320, 0, 65536), (5320, 5539, 65536, 65536[171 chars], 0)]
First differing element 0:
(0, 5280, 0, 65536)
(0, 5320, 0, 65536)
Diff is 740 characters long. Set self.maxDiff to None to see it.
----------------------------------------------------------------------
Ran 1 test in 25.124 seconds
FAILED (failures = 1)

Steps to reproduce

Run test_bgzf.py on ARM64 hardware.

Activity

  1. peterjc commented on Jun 22, 2018

    @peterjc
    MemberAuthor

    Having written this out in full, with the relevant bits of the Fedora build logs only, it is clear that only the "Reproduce BGZF compression for ..." tests fail. IIRC, that is relatively harmless and would point at this being down to a difference in the underlying GZIP compression we invoke via zlib. We don't actually require to be able to recreate bit identical compressed output, but it is nice that on other platforms we can.

    i.e. This is could be just a harmless cross platform zlib output difference?

  2. vielmetti commented on Jun 22, 2018

    @vielmetti

    @peterjc - what's the underlying GZIP and zlib implementation on each system? Is it possible that there's a version skew hiding one layer down that's causing this?

    I'm looking at https://docs.python.org/3.7/library/zlib.html

    For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library. The zlib library has its own home page at http://www.zlib.net. There are known incompatibilities between the Python module and versions of the zlib library earlier than 1.1.3; 1.1.3 has a security vulnerability, so we recommend using 1.1.4 or later.

  3. peterjc commented on Jun 22, 2018

    @peterjc
    MemberAuthor

    This reports the version of the Python standard library zlib, but that does not seem helpful based on my desktop:

    $ python2.6 -c "import zlib; print(zlib.__version__)"
    1.0
    

    While using Python 3.7.0rc1,

    $ python3.7 -c "import zlib; print(zlib.__version__)"
    1.0
    

    Hopefully @sagitter knows how to easily work out the underlying zlib library being used on the different CPU platforms for Fedora?

  4. vielmetti commented on Jun 25, 2018

    @vielmetti
  5. peterjc commented on Jun 25, 2018

    @peterjc
    MemberAuthor

    Thanks @vielmetti - Well spotted. Two working version on my macOS laptop,

    $ python2.7 -c "import zlib; print(zlib.ZLIB_VERSION)"
    1.2.8
    $ python3.6 -c "import zlib; print(zlib.ZLIB_VERSION)"
    1.2.11
    

    If we can check the version on ARM64 that will help, even if just rule it out as a simple explanation.

  6. vielmetti commented on Jun 27, 2018

    @vielmetti

    On my Cavium ThunderX / Ubuntu 16.04 / Packet c1.large.arm machine I have this:

    ed@ed-2a-bcc-llvm:~$ python --version
    Python 2.7.12
    ed@ed-2a-bcc-llvm:~$ python -c "import zlib; print(zlib.ZLIB_VERSION)"
    1.2.8
    
    ed@ed-2a-bcc-llvm:~$ python3
    Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
    [GCC 5.4.0 20160609] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    ed@ed-2a-bcc-llvm:~$ python3 -c "import zlib; print(zlib.ZLIB_VERSION)"
    1.2.8
    

    I'll check next with a newer Python 3.x

  7. vielmetti commented on Jun 28, 2018

    @vielmetti
  8. peterjc commented on Jun 29, 2018

    @peterjc
    MemberAuthor

    As soon as TravisCI have Python 3.7 enabled, I'll happily enable that for our automated testing. At some point I will install it locally as well...

  9. vielmetti commented on Jul 3, 2018

    @vielmetti

    The relevant issue at Travis CI re Python 3.7 is travis-ci/travis-ci#9815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions