From d34a9067c27750f4936a623825010a4efca8307c Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 21 Mar 2024 01:08:51 +0200 Subject: [PATCH] tst_qdir: optimize setPath() test On Linux "../" is /tmp, which is more likely to cause issues with the dir.entrylist() below used in that test; /tmp could have a lot of temporary files, any of them can be gone in a jiffy. Noticed this test occasionally falking out when running tests in parallel (`ctest -R "foo|bar" -j3`). This may be an unintentional side effect of b3e9e80719f5a69c8f28f6eceaadbbdd7f1f5fe5, which changed the code to use a temporary dir for testing instead of creating/deleting dirs in the source dir ("../" from the source dir has a more stable entries count than /tmp). Change-Id: I98da86223792bc9f34c173fc02cc84049ed699ae Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 895f6e0998..77b3eee0f1 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -341,6 +341,7 @@ void tst_QDir::setPath() QFETCH(QString, dir1); QFETCH(QString, dir2); + QDir::setCurrent(m_dataPath + "/entrylist"_L1); QDir shared; QDir qDir1(dir1); QStringList entries1 = qDir1.entryList();