test_get_boxes fails on s390x (big-endian)
Building paperwork-backend
on s390x
and then running tests fails this one test:
======================================================================
FAIL: test_get_boxes (model.tests_pdf.TestHocr)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/paperwork-backend-2.0.2/tests/model/tests_pdf.py", line 80, in test_get_boxes
self.assertEqual(lines[0].position, ((227, 228), (656, 281)))
AssertionError: Tuples differ: ((0, 0), (656, 281)) != ((227, 228), (656, 281))
First differing element 0:
(0, 0)
(227, 228)
- ((0, 0), (656, 281))
? ^ ^
+ ((227, 228), (656, 281))
? ^^^ ^^^
I tried to simplify the test into a simple script to figure out what's going on, but this is as far as I got:
import os
import openpaperwork_core
core = openpaperwork_core.Core(auto_load_dependencies=True)
core.load("paperwork_backend.model.pdf")
core.init()
simple_doc_url = 'file://' + os.path.abspath('tests/model/simple_doc.pdf')
full_doc_url = 'tests/model/'
mapping = 'file://' + os.path.join(full_doc_url, 'page_map.csv')
if core.call_success("fs_exists", mapping):
core.call_all("fs_unlink", mapping)
try:
lines = list(core.call_success("page_get_boxes_by_url", simple_doc_url, 0))
print(lines)
assert len(lines) == 2
assert lines[0].position == ((227, 228), (656, 281))
finally:
pass
The problem is that somehow I still need the try
around the last bit, as otherwise it magically works. Is there maybe some kind of subprocess/threading wait in core.call_success
that makes things a bit flaky? I'm not sure why it only manifests on s390x
though.
Edited by Elliott Sales de Andrade