From 6e745ecda73c360195de8760473eca88b31f87cf Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 2 Aug 2011 10:22:08 +1000 Subject: test: improved stability of tst_qwaitcondition Increased thread wait timeout from 3 to 10 milliseconds, for slower or heavily loaded machines. (There was a previous attempt to improve stability of this test some time ago by increasing the timeout from 1 to 3 milliseconds.) Note that this increases the runtime of the wakeOne test from ~5 to ~14 seconds. Change-Id: Ib556d4c949a6989fe71c11f5dc10feb2ec45c512 Reviewed-on: http://codereview.qt.nokia.com/2458 Reviewed-by: Qt Sanity Bot Reviewed-by: Kalle Lehtonen --- tests/auto/qwaitcondition/tst_qwaitcondition.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp index c677d17fbe..6545df9189 100644 --- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp @@ -491,7 +491,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 3 : 1000)) { + if (thread[y].wait(exited > 0 ? 10 : 1000)) { thread_exited[y] = TRUE; ++exited; } @@ -535,7 +535,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 3 : 1000)) { + if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { thread_exited[y] = TRUE; ++exited; } @@ -587,7 +587,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 3 : 1000)) { + if (thread[y].wait(exited > 0 ? 10 : 1000)) { thread_exited[y] = TRUE; ++exited; } @@ -633,7 +633,7 @@ void tst_QWaitCondition::wakeOne() for (int y = 0; y < ThreadCount; ++y) { if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 3 : 1000)) { + if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { thread_exited[y] = TRUE; ++exited; } -- cgit v1.2.3