aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlengine')
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 74e54b64e9..9c155eda5b 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -275,6 +275,12 @@ void tst_qqmlengine::clearComponentCache()
// Modify qml file
{
+ // On macOS with HFS+ the precision of file times is measured in seconds, so to ensure that
+ // the newly written file has a modification date newer than an existing cache file, we must
+ // wait.
+ // Similar effects of lacking precision have been observed on some Linux systems.
+ QThread::sleep(1);
+
QFile file("temp.qml");
QVERIFY(file.open(QIODevice::WriteOnly));
file.write("import QtQuick 2.0\nQtObject {\nproperty int test: 11\n}\n");