Bug#1031980: apertium: FTBFS on riscv64 (test timeout)

Eric Long i at hack3r.moe
Sun Feb 26 10:22:18 GMT 2023


Source: apertium
Version: 3.8.3-1
Severity: important
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
User: debian-riscv at lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: i at hack3r.moe

Dear maintainers,

apertium fails to build on riscv64, for it exceeds the 2-second timeout in
test, which is too short considering its performance:

```
runTest (adaptdocx.AdaptDocxTest.runTest) ... ok
runTest (adaptdocx.CorrectBoundariesTest.runTest) ... ERROR
runTest (adaptdocx.NoNewlinesTest.runTest) ... ok
runTest (adaptdocx.SameTextTest.runTest) ... ERROR

======================================================================
ERROR: runTest (adaptdocx.CorrectBoundariesTest.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 65, in runTest
    obtingut = self.extractText("data/" + nom + ".xml", True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 45, in extractText
    result = self.runCheckExit(proc, entrada)[0]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 22, in runCheckExit
    res = proc.communicate(inp, timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1207, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 2060, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
  File "/usr/lib/python3.11/subprocess.py", line 1251, in _check_timeout
    raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['python3', 'adaptdocx/extract_docx.py']' timed out after 2 seconds

======================================================================
ERROR: runTest (adaptdocx.SameTextTest.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 56, in runTest
    original = [linia.replace("|", "") for linia in self.extractText("data/" + nom + ".xml", False)]
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 45, in extractText
    result = self.runCheckExit(proc, entrada)[0]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/tests/adaptdocx/__init__.py", line 22, in runCheckExit
    res = proc.communicate(inp, timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1207, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 2060, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
  File "/usr/lib/python3.11/subprocess.py", line 1251, in _check_timeout
    raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['python3', 'adaptdocx/extract_docx.py']' timed out after 2 seconds

----------------------------------------------------------------------
Ran 4 tests in 4.214s

FAILED (errors=2)
```

Full buildd log: https://buildd.debian.org/status/fetch.php?pkg=apertium&arch=riscv64&ver=3.8.3-1%2Bb2&stamp=1676895416&raw=0

I've attached a patch that extends the timeout to 30 seconds. If more help is
needed, please let me know.

Cheers,
Eric
-------------- next part --------------
--- a/tests/adaptdocx/__init__.py
+++ b/tests/adaptdocx/__init__.py
@@ -2,6 +2,7 @@
 # -*- coding: utf-8 -*-
 
 import unittest
+import platform
 
 from subprocess import Popen, PIPE
 
@@ -18,7 +19,10 @@
     def runCheckExit(self, proc, inp):
         """Run proc on input, then close and assert that we exited with 0.
 Return output from proc."""
-        timeout = 2
+        if platform.prcessor() == "riscv64":
+            timeout = 30
+        else:
+            timeout = 2
         res = proc.communicate(inp, timeout)
         for fd in [proc.stdin, proc.stdout, proc.stderr]:
             if fd is not None:


More information about the debian-science-maintainers mailing list