diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2017-08-14 21:26:38 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-22 05:10:48 +0000 |
commit | d044b0b1e3012b702877ba95ce4c847831158ab3 (patch) | |
tree | 2ca1529cb2d911767a7a90792fbd10a400d588c1 /tests/auto/corelib | |
parent | 1497e5853beac21c1d40ea377f6d6f41b5a30082 (diff) |
Remove timer checks from testQuitLock
This test sets up two timers:
- a 100ms recurring timer
- a series of 10 200ms single-shot timers.
After quitLock lets exec() return it then uses a signal
spy to check if the 100ms timer fired at least 17/20
of the times it should.
However there is no guarantee that the 100ms timer
will fire more often than the 200ms timer. If the
native timer callbacks happen at 500ms intervals then
Qt will fire both timers (once) at that interval.
In practice this seems to happen on macOS CI under
system load and/or with the test app napping.
The primary goal for the test is to verify that exec()
returns when it should; we can remove the timer signal
spy.
Remove testQuitLock from BLACKLIST.
Timely timer:
524429311.389913 runLoopTimerCallback
524429311.389979 200ms fire
524429311.389997 100ms fire
524429311.490056 runLoopTimerCallback
524429311.490130 100ms fire
524429311.589752 runLoopTimerCallback
524429311.589929 200ms fire
524429311.589976 100ms fire
Delayed timer:
524429428.690887 runLoopTimerCallback
524429428.691002 100ms fire
524429428.691143 200ms fire
524429433.692103 runLoopTimerCallback
524429433.692205 100ms fire
524429433.692331 200ms fire
Change-Id: Iff4faaa1de3741cf4e217949d5ed17d4e70c6af2
Task-number: QTBUG-61499
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 0b4f76ef70..109f5b77f6 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -637,11 +637,6 @@ void tst_QEventLoop::testQuitLock() { QEventLoop eventLoop; - QTimer timer; - timer.setInterval(100); - QSignalSpy timerSpy(&timer, &QTimer::timeout); - timer.start(); - QEventLoopPrivate* privateClass = static_cast<QEventLoopPrivate*>(QObjectPrivate::get(&eventLoop)); QCOMPARE(privateClass->quitLockRef.load(), 0); @@ -655,9 +650,6 @@ void tst_QEventLoop::testQuitLock() QCOMPARE(privateClass->quitLockRef.load(), 0); - // The job takes long enough that the timer times out several times. - QVERIFY(timerSpy.count() > 3); - timerSpy.clear(); job1 = new JobObject(&eventLoop, this); job1->start(200); @@ -670,11 +662,6 @@ void tst_QEventLoop::testQuitLock() } eventLoop.exec(); - - qDebug() << timerSpy.count(); - // The timer times out more if it has more subjobs to do. - // We run 10 jobs in sequence here of about 200ms each. - QVERIFY(timerSpy.count() > 17); } QTEST_MAIN(tst_QEventLoop) |