diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-02-14 07:03:18 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-17 05:25:26 +0100 |
commit | 2193df65a380e27b839bae3dc63ad7496af575e8 (patch) | |
tree | dd049950377f2450b685f8ffd4fe7bb89038c7fe /tests/auto/corelib/io | |
parent | 64642a4d9768b767c51c7f92dec94f655ba60195 (diff) |
Fix tst_QFileSystemWatcher failure on Mac OS X
The watchFileAndItsDirectory() test would fail due to atime updates for
the first watched file coming up to 2 seconds after the file was closed.
Observation shows that the atime has a 2 second resolution on Mac OS X
using HFS+, so add an appropriate delay to make sure that the atime
update from the kqueue based file system watcher can dispatch all
updates.
Task-number: QTBUG-22744
Change-Id: Ie79af20d6b4c154021307c8a8f6d336369720337
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r-- | tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro | 2 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro index e712a6ad5f..8ada44fdf7 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro +++ b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro @@ -2,5 +2,3 @@ CONFIG += testcase parallel_test TARGET = tst_qfilesystemwatcher QT = core testlib SOURCES = tst_qfilesystemwatcher.cpp - -mac: CONFIG += insignificant_test # QTBUG-22744 diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 2635565c2b..8caccb6da9 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -432,6 +432,11 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() testFile.write(QByteArray("hello again")); testFile.close(); +#ifdef Q_OS_MAC + // wait again for the file's atime to be updated + QTest::qWait(2000); +#endif + QTRY_VERIFY(fileChangedSpy.count() > 0); //according to Qt 4 documentation: |