#1109924 asammdf:FTBFS:build failed( assert self._file_path.exists(), "Provided file does not exist")

#1109924#5
Date:
2025-07-26 09:55:35 UTC
From:
To:
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)

 [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
 [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

#1109924#10
Date:
2025-08-21 21:48:58 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
asammdf, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1109924@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Alexandre Detiste <tchet@debian.org> (supplier of updated asammdf package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 21 Aug 2025 23:29:35 +0200
Source: asammdf
Architecture: source
Version: 8.5.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Alexandre Detiste <tchet@debian.org>
Closes: 1109924 1111778
Changes:
 asammdf (8.5.2-2) unstable; urgency=medium
 .
   * Build depends on python3-pyside6.qtwebenginewidgets to only build on
     arches were asammdf is installable. (Closes: #1111778)
   * That also means no riscv64 for now (Closes: #1109924)
 .
   [ Sébastien Noel ]
   * Fix reproducible builds
Checksums-Sha1:
 832fe0aac1776c1184a8ec49f2405b41acc8eb62 2612 asammdf_8.5.2-2.dsc
 eff58a6ab5a70f7703d89ed2568d985466c1f5d3 3516 asammdf_8.5.2-2.debian.tar.xz
 9fc18016504b6ab69353b15844ce39f003456add 17755 asammdf_8.5.2-2_source.buildinfo
Checksums-Sha256:
 2f9ced9df13282a64f23bba80dd57e525d02a8e28000a93c090f98c42d48f64e 2612 asammdf_8.5.2-2.dsc
 c8fcb7aee79f97adbd171c9e3dafdc1cd41760c175d8091bbe9ffb299cf64ca9 3516 asammdf_8.5.2-2.debian.tar.xz
 f899e9a89b327728e538f46a352529541311350222057f9729452f44409acb99 17755 asammdf_8.5.2-2_source.buildinfo
Files:
 1218e5db44cd41b43745daa347bd0d96 2612 python optional asammdf_8.5.2-2.dsc
 3da7fff88621a6a49bbcae780644f503 3516 python optional asammdf_8.5.2-2.debian.tar.xz
 5877933d4cd820e11ded933f034224f6 17755 python optional asammdf_8.5.2-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEEj23hBDd/OxHnQXSHMfMURUShdBoFAminkKsRHHRjaGV0QGRl
Ymlhbi5vcmcACgkQMfMURUShdBrlGw/+NVZWMnQv2xLg7weosvFBfx+r7Pp4jAmH
+3t9DPHehaFV2Qmgw7x2X9uwdnO1EJvziku/u52IaeyA1ncNRc4NXLEP+/+2wok/
PCufKSVtvosrDJ3zW+Mo7TlLCR2xchxBdkptAMxa023lbHDZ//UZQBN7+VqrHY46
bADsBFvAdm+rg53LBMWMmVTqyVbI5NQDOsbVlvpAyinLu6C6pD/7bfTWm4rNDTbJ
p/EHqoCb05xXvc/dQkfS9BEO+mtwu6Ukx/3Mf8mbUxHD/IYiZ9/jvAzFc1J2AfzS
gpbqzXQ+gR9APETZ0QV2aG/AreG2sFKp4tlekQNh+4I838qjz7KI6OkyjTQ5XFHP
DQhnhzPaj4zayVObYsLAr+XIP2pOIPN9ANHvem61vfp1i/FSZU1dk0JFRzVdD110
7sKhekJlU8nWjIEC1lnbeXfo6VcWQcKmdPnmRjb6y+MAhCn0W1/Obx/RmV1Omjv0
OGcNOENEupAkyPpCaxsY7b0Nyx7ylP6jUxdXBw/BUv2DdJFP9LSY03fUPuyqb53o
Y8yngXSZna+GU0rZHHpbVrUQdgX9lMgQlVY/u7LUxL7on5v0RONcjs98jAZuooyT
uDp/SeunMYmNI6pRD6eNJQ9PxadSvN3K7kUlaGAnd5ofTDON9AJih0Yqi0YHMp5R
+eSPcXigSMg=
=er00
-----END PGP SIGNATURE-----