From 009b76057e8264cd7f137fc246c0b54186d5f371 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Fri, 18 Jan 2019 14:09:45 +0100 Subject: Fix the flaky applicationinstaller autotest Sometimes the mount is not finished yet when we want to create the folder for the images. By waiting at least 200ms we can be sure it's finished. Change-Id: Ic29084f28d64c4e9576fba6370e78f3cf56f7e31 Reviewed-by: Robert Griebl --- tests/applicationinstaller/tst_applicationinstaller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/applicationinstaller/tst_applicationinstaller.cpp b/tests/applicationinstaller/tst_applicationinstaller.cpp index d3d5b80a..80fa4601 100644 --- a/tests/applicationinstaller/tst_applicationinstaller.cpp +++ b/tests/applicationinstaller/tst_applicationinstaller.cpp @@ -340,6 +340,10 @@ void tst_ApplicationInstaller::initTestCase() QVERIFY2(m_sudo->mkfs(m_loopbackForSDCard[i], "vfat"), qPrintable(m_sudo->lastError())); QVERIFY2(m_sudo->mount(m_loopbackForSDCard[i], pathTo(i == 0 ? SDCard0 : SDCard1), false, "vfat"), qPrintable(m_sudo->lastError())); + // Wait for the mount to be completed. Usually this is not needed, but sometimes the + // mount takes longer and then the mkdir command will fail afterwards. + QTest::qSleep(200); + // those paths have been hidden due to the mount, so recreate them QVERIFY(QDir().mkdir(pathTo(i == 0 ? SDCard0Images : SDCard1Images))); } -- cgit v1.2.3