diff options
author | Christian Andersen <csandersen3@gmail.com> | 2019-01-27 18:19:21 +0100 |
---|---|---|
committer | Christian Andersen <csandersen3@gmail.com> | 2019-01-27 17:53:31 +0000 |
commit | e85f43fd4ded62ab4b63185fba54f308d73306fd (patch) | |
tree | d7f24c719d9bfe000b12873b9d3d7dfee69ae2a7 /tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | |
parent | 315969725da24c336b5dd5c5463c605ee679781d (diff) |
tst_QTimer: relax time requirement on remaining time
Before this the remaining time in the two tests 'remainingTime' and
'basic_chrono' had to be within the interval [100,200]. This relaxes
that to [50,200]. This test seems to be failing a lot when staging
changes in gerrit. I can reproduce some of the problem when putting a
lot of load on my system and running the tests, then remaining time is
very random.
Also removes the blacklist of remaingTime on Windows and macOS, as
basic_chrono and remaningTime tests are basically the same. The
tests also fails on Linux some times in gerrit.
I was also thinking one could:
- blacklist both tests
- remove interval requirements; just check remaining time is [0,200]
- remove the tests
Task-number: QTBUG-61013
Change-Id: I5c8f0754d059598e023fe8e5d511f4a50bb4bac2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp')
-rw-r--r-- | tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 8d194dafc1..cd78da725c 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -133,14 +133,14 @@ void tst_QTimer::remainingTime() QCOMPARE(timeoutSpy.count(), 0); int remainingTime = timer.remainingTime(); - QVERIFY2(qAbs(remainingTime - 150) < 50, qPrintable(QString::number(remainingTime))); + QVERIFY2(remainingTime >= 50 && remainingTime <= 200, qPrintable(QString::number(remainingTime))); QVERIFY(timeoutSpy.wait()); QCOMPARE(timeoutSpy.count(), 1); // the timer is still active, so it should have a non-zero remaining time remainingTime = timer.remainingTime(); - QVERIFY2(remainingTime > 150, qPrintable(QString::number(remainingTime))); + QVERIFY2(remainingTime >= 50, qPrintable(QString::number(remainingTime))); } void tst_QTimer::remainingTimeDuringActivation_data() @@ -228,7 +228,7 @@ void tst_QTimer::basic_chrono() QCOMPARE(timeoutSpy.count(), 0); milliseconds rt = timer.remainingTimeAsDuration(); - QVERIFY2(qAbs(rt.count() - 150) < 50, qPrintable(QString::number(rt.count()))); + QVERIFY2(rt.count() >= 50 && rt.count() <= 200, qPrintable(QString::number(rt.count()))); timeoutSpy.clear(); timer.setSingleShot(true); |