Skip to content

N5 hexdigest tests assume little-endianness #13

Description

@QuLogic

Zarr version

2.14.2

Numcodecs version

0.11.0

Python Version

3.11.2

Operating System

Fedora Rawhide

Installation

from source

Description

When running tests on s390x (a big-endian machine), the N5 hexdigest tests fail. This seems to be a similar issue to zarr-developers/zarr-python#425 but in a new set of tests, and might perhaps be fixable in the same way.

_____________________ TestArrayWithN5Store.test_hexdigest ______________________
self = <zarr.tests.test_core.TestArrayWithN5Store testMethod=test_hexdigest>
    def test_hexdigest(self):
        found = []
    
        # Check basic 1-D array
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with different type
        z = self.create_array(shape=(1050,), chunks=100, dtype='<f4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 2-D array
        z = self.create_array(shape=(20, 35,), chunks=10, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with some data
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z[200:400] = np.arange(200, 400, dtype='i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with attributes
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z.attrs['foo'] = 'bar'
        found.append(z.hexdigest())
        z.store.close()
    
>       assert self.expected() == found
E       AssertionError: assert ['8811a77d54c...d30c80dfc372'] == ['00227ef5c88...0d1b49aa77d4']
E         At index 0 diff: '8811a77d54caaa1901d5cc4452d946ae433c8d90' != '00227ef5c88a49c1f48be88b2bb17d37f7a5939e'
E         Use -v to get more diff
zarr/tests/test_core.py:615: AssertionError
____________________ TestArrayWithN5FSStore.test_hexdigest _____________________
self = <zarr.tests.test_core.TestArrayWithN5FSStore testMethod=test_hexdigest>
    def test_hexdigest(self):
        found = []
    
        # Check basic 1-D array
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with different type
        z = self.create_array(shape=(1050,), chunks=100, dtype='<f4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 2-D array
        z = self.create_array(shape=(20, 35,), chunks=10, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with some data
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z[200:400] = np.arange(200, 400, dtype='i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with attributes
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z.attrs['foo'] = 'bar'
        found.append(z.hexdigest())
        z.store.close()
    
>       assert self.expected() == found
E       AssertionError: assert ['8811a77d54c...d30c80dfc372'] == ['00227ef5c88...0d1b49aa77d4']
E         At index 0 diff: '8811a77d54caaa1901d5cc4452d946ae433c8d90' != '00227ef5c88a49c1f48be88b2bb17d37f7a5939e'
E         Use -v to get more diff
zarr/tests/test_core.py:615: AssertionError

Steps to reproduce

$ pytest

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions