Source: asammdf Version: 8.5.1-1 Severity: important Tags: FTBFS, patch User: [email protected] Usertags: riscv64
Dear asammdf maintainer,
The package asammdf build failed on riscv64.The crucial buildd log below:
```
=================================== FAILURES ===================================
[31m [1m_____________
TestTabModifyAndExport.test_PushButton_ScrambleTexts _____________ [0m
self =
<test.asammdf.gui.widgets.file.test_FileWidget_TabModifyAndExport.TestTabModifyAndExport
testMethod=test_PushButton_ScrambleTexts>
def test_PushButton_ScrambleTexts(self):
"""
Events:
- Open 'FileWidget' with valid measurement.
- Go to Tab: "Modify & Export": Index 1
- Press PushButton "Scramble texts"
Evaluate:
- New file is created
- No channel from first file is found in 2nd file (scrambled file)
"""
# Setup
measurement_file = str(pathlib.Path(self.test_workspace,
"ASAP2_Demo_V171.mf4"))
shutil.copy(pathlib.Path(self.resource,
"ASAP2_Demo_V171.mf4"), measurement_file)
# Event
self.setUpFileWidget(measurement_file=measurement_file, default=True)
# Go to Tab: "Modify & Export": Index 1
self.widget.aspects.setCurrentIndex(1)
# Press PushButton ScrambleTexts
QtTest.QTest.mouseClick(self.widget.scramble_btn,
QtCore.Qt.MouseButton.LeftButton)
channels = list(self.widget.mdf.channels_db)
# Evaluate
scrambled_filepath = pathlib.Path(self.test_workspace,
"ASAP2_Demo_V171.scrambled.mf4")
# Wait for Thread to finish
time.sleep(0.1)
> with OpenMDF(scrambled_filepath) as mdf_file:
[1m [31mtest/asammdf/gui/widgets/file/test_FileWidget_TabModifyAndExport.py
[0m:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test.asammdf.gui.test_base.OpenMDF object at 0x3f484879b0>
file_path =
PosixPath('/build/reproducible-path/asammdf-8.5.1/.pybuild/cpython3_3.13/build/test/asammdf/gui/test_workspace/ASAP2_Demo_V171.scrambled.mf4')
def __init__(self, file_path: str | pathlib.Path):
"""
Parameters
----------
file_path: file path as str or pathlib.Path object
"""
self.file = None
if isinstance(file_path, str):
self._file_path = pathlib.Path(file_path)
else:
self._file_path = file_path
> assert self._file_path.exists(), "Provided file does not exist"
[1m [31mE AssertionError: Provided file does not exist [0m
[1m [31mE assert False [0m
[1m [31mE + where False = exists() [0m
[1m [31mE + where exists =
PosixPath('/build/reproducible-path/asammdf-8.5.1/.pybuild/cpython3_3.13/build/test/asammdf/gui/test_workspace/ASAP2_Demo_V171.scrambled.mf4').exists
[0m
[1m [31mE + where
PosixPath('/build/reproducible-path/asammdf-8.5.1/.pybuild/cpython3_3.13/build/test/asammdf/gui/test_workspace/ASAP2_Demo_V171.scrambled.mf4')
= <test.asammdf.gui.test_base.OpenMDF object at
0x3f484879b0>._file_path [0m
[1m [31mtest/asammdf/gui/test_base.py [0m:494: AssertionError
```
The full buildd log is here:
https://buildd.debian.org/status/fetch.php?pkg=asammdf&arch=riscv64&ver=8.5.1-1&stamp=1752061147&raw=0
My solution to this issue:
The failing test is
`TestTabModifyAndExport.test_PushButton_ScrambleTexts`, which checks the
file-scrambling functionality of the GUI. The test fails because it asserts
the existence of the scrambled output file before it has been created,
resulting in an `AssertionError: Provided file does not exist`.The root
cause appears to be a timing issue. The file scrambling operation runs in a
background thread, and the test uses a fixed `time.sleep(0.1)` to wait for
completion. This brief delay is insufficient on slower or more heavily
loaded build systems, which is often the case for non-amd64
architectures.My proposed solution is to replace the unreliable
fixed-duration sleep with a more robust polling mechanism. The patch I've
prepared modifies the test to repeatedly check for the existence of the
output file with a 5-second timeout. This makes the test resilient to
performance variations across different build environments without
unnecessarily slowing down the test suite on faster systems.I have attached
a debdiff containing the patch that resolves this issue. After applying the
patch, the package builds successfully.Please consider applying this patch.
Thank you for your work on this package.
Gui-Yue
Best Regards
fix_asammdf_test_file_missing.patch
Description: Binary data

