Skip to content

CI random failure in TestImageFileDialogInteraction.testClickOnBackToParentTool test #4134

@t20100

Description

@t20100

There is a random test failure in TestImageFileDialogInteraction.testClickOnBackToParentTool:

Occured in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072591

and also in the project CI:

CI logs
=================================== FAILURES ===================================
__________ TestImageFileDialogInteraction.testClickOnBackToParentTool __________

self = <silx.gui.dialog.test.test_imagefiledialog.TestImageFileDialogInteraction testMethod=testClickOnBackToParentTool>

    def testClickOnBackToParentTool(self):
        dialog = self.createDialog()
        dialog.show()
        self.qWaitForWindowExposed(dialog)
    
        url = testutils.findChildren(dialog, qt.QLineEdit, name="url")[0]
        action = testutils.findChildren(dialog, qt.QAction, name="toParentAction")[0]
        toParentButton = testutils.getQToolButtonFromAction(action)
        filename = _tmpDirectory + "/data/data.h5"
    
        # init state
        path = silx.io.url.DataUrl(file_path=filename, data_path="/group/image").path()
        dialog.selectUrl(path)
        self.qWaitForPendingActions(dialog)
        path = silx.io.url.DataUrl(
            scheme="silx", file_path=filename, data_path="/group/image"
        ).path()
        self.assertSamePath(url.text(), path)
        # test
        self.mouseClick(toParentButton, qt.Qt.LeftButton)
        self.qWaitForPendingActions(dialog)
        path = silx.io.url.DataUrl(
            scheme="silx", file_path=filename, data_path="/"
        ).path()
        self.assertSamePath(url.text(), path)
    
        self.mouseClick(toParentButton, qt.Qt.LeftButton)
        self.qWaitForPendingActions(dialog)
        self.assertSamePath(url.text(), _tmpDirectory + "/data")
    
        self.mouseClick(toParentButton, qt.Qt.LeftButton)
        self.qWaitForPendingActions(dialog)
>       self.assertSamePath(url.text(), _tmpDirectory)

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/silx/gui/dialog/test/test_imagefiledialog.py:285: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <silx.gui.dialog.test.test_imagefiledialog.TestImageFileDialogInteraction testMethod=testClickOnBackToParentTool>
path1 = '/var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh/data'
path2 = '/var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh'

    def assertSamePath(self, path1, path2):
        path1_ = os.path.normcase(path1)
        path2_ = os.path.normcase(path2)
        if path1_ != path2_:
            # Use the unittest API to log and display error
>           self.assertEqual(path1, path2)
E           AssertionError: '/var[37 chars]000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh/data' != '/var[37 chars]000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh'
E           - /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh/data
E           ?                                                                                                   -----
E           + /var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/silx.gui.dialog.test.test_imagefiledialogvf01x4dh

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/silx/gui/dialog/test/test_imagefiledialog.py:136: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions