gmr / pamqp

Low level AMQP frame encoding and decoding library
https://pamqp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 20 forks source link

Three failed tests on i586 and armv7l in decoding_tests.CodecDecodeTests class #11

Closed mcepl closed 6 years ago

mcepl commented 6 years ago

Tests test_decode_by_type_long_long_data_type, test_decode_embedded_value_long_long_data_type, and test_decode_long_long_int_data_type fail on i586 and armv7l with the latest development version of OpenSUSE. I am not sure what's the unifying link between these two architectures (armv7l is 64bit, isn't it?), perhaps too small memory or something?

build logs on i586 build logs on armv7l

scarabeusiv commented 6 years ago

Actually the issue is both of these are 32bit platforms, thus long long != int conversion there.

gmr commented 6 years ago

The implications of supporting a 32-bit system are a bit interesting. The field type isn't actively used in AMQP as far as the core protocol/frames, so this failed test isn't indicating a major issue.

Most likely the data type is coming back as a long, but I believe the error is being raised by Unittest.TestCase.assertEqual complaining about type differences. I'm wondering if it makes sense to make conditional unittests for 32 bit platforms for these three tests.

gmr commented 6 years ago

I've updated the tests to address this (I think). It'd be great if you can test against master or 1.7 and let me know.

gmr commented 6 years ago

Will close this. Feel to free open if the latest version didn't address this.

scarabeusiv commented 6 years ago

I can confirm the patch fixes the issue :)

scarabeusiv commented 6 years ago

Actually with the 2.0 release one of the tests fail again:

[   11s] FAIL: test_decode_embedded_value_long_uint_data_type (test_decoding.CodecDecodeTests)
[   11s] ----------------------------------------------------------------------
[   11s] Traceback (most recent call last):
[   11s]   File "/home/abuild/rpmbuild/BUILD/pamqp-2.0.0/tests/test_decoding.py", line 587, in test_decode_embedded_value_long_uint_data_type
[   11s]     self.assertIsInstance(decode._embedded_value(value)[1], int)
[   11s] AssertionError: 4294967295L is not an instance of <type 'int'>
gmr commented 6 years ago

Python 2?

mcepl commented 6 years ago

Yes, Python 2 only. The testsuite passes without problems on Python 3.7.