qt5base-lts/tests/auto/corelib/kernel
Jarek Kobus db3d5a3097 Fix flaky QTimer::remainingTime() test
Before, we used not so accurate QTest::qWait(50)
to measure the accuracy of more precise timer's interval.
In addition, the checked range for remainingTime (50, 200)
was probably wrong, since by definition it couldn't be more than 150,
as we started the timer with interval of 200 and waited at least 50.

In this fix we have additional "tester" timer to measure remainingTime
of "tested" timer. The "tester" is a singleShot timer with interval of
50, and is started together with "tested" timer. Whenever the "tested"
timer timeouts, it restarts the "tester" timer - this is done desired
number of times (2 by default, like in the original test).

The test itself lies now inside tester's lambda. We fix the tested
range (at least 1, no more than 150). The minimum value could in
theory be greater, but it's enough to test that it's not overdue.

Finally, we wait for expected number of test runs. We give it twice
as much time as is in theory needed.

Task-number: QTBUG-83419
Task-number: QTBUG-58519
Change-Id: I43836d787d804f22bb66515ebb215d040189c4f3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-10 02:49:59 +02:00
..
qcoreapplication Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
qdeadlinetimer CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qelapsedtimer CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qeventdispatcher Synchronize QEventDispatcherWin32::processEvents() with QCoreApplication 2020-08-26 11:08:15 +03:00
qeventloop CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qmath CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qmetacontainer Add a QMetaSequence interface 2020-09-01 13:35:39 +02:00
qmetaenum CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qmetamethod Improve connect: Use existing metatypes if possible 2020-08-28 00:41:00 +02:00
qmetaobject Deprecate the static int based API in QMetaType 2020-08-24 00:19:05 +02:00
qmetaobjectbuilder CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qmetaproperty Deprecate the static int based API in QMetaType 2020-08-24 00:19:05 +02:00
qmetatype Reimplement QSequentialIterable using QMetaSequence 2020-09-03 08:27:44 +02:00
qmimedata CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qobject QObject: add a single shot connection flag 2020-09-01 17:59:36 +02:00
qpointer CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qproperty Fix QPropertyAlias to work with all kinds of properties 2020-09-02 22:44:29 +02:00
qsharedmemory CMake: Regenerate subdir test projects 2020-07-09 09:38:39 +02:00
qsignalblocker CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qsignalmapper CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qsocketnotifier CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qsystemsemaphore CMake: Regenerate subdir test projects 2020-07-09 09:38:39 +02:00
qtimer Fix flaky QTimer::remainingTime() test 2020-09-10 02:49:59 +02:00
qtranslator Make QTranslator::load() insist that its return value be checked 2020-08-28 21:26:21 +02:00
qvariant Reimplement QSequentialIterable using QMetaSequence 2020-09-03 08:27:44 +02:00
qwineventnotifier CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
.prev_CMakeLists.txt Add a QMetaSequence interface 2020-09-01 13:35:39 +02:00
CMakeLists.txt Add a QMetaSequence interface 2020-09-01 13:35:39 +02:00
kernel.pro Add a QMetaSequence interface 2020-09-01 13:35:39 +02:00