From ac384524c8fa6b19153811e2eaf6dac6b911f930 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 14 Oct 2016 14:51:16 +0200 Subject: [PATCH] Speculative fix for tst_QThread::wait2() flakiness This test fails on Windows occasionally with values just short of 800, the lowest observed being 791. It is probably rounding somehow to 10ms segments, so allow it to be up to 10 ms too fast. Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira Reviewed-by: Simon Hausmann --- tests/auto/corelib/thread/qthread/tst_qthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 3230472d5b..d7294c3ee6 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -1082,8 +1082,8 @@ void tst_QThread::wait2() thread.start(); timer.start(); QVERIFY(!thread.wait(Waiting_Thread::WaitTime)); - qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 1). - QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed))); + qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 9). + QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 10, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed))); timer.start(); thread.cond1.wakeOne();