summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2012-05-31 12:47:32 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-31 05:37:25 +0200
commitc09b5f5ad869e97f0b1eac93ca79d472a0405294 (patch)
tree831decc4cf5596d56725cb3a33287f3ef628f617
parentaf8fa2794b4d1580ad69ac7de40761634cb0fa39 (diff)
Improved stability of tst_qstatemachine, mark as parallel-safe
tst_QStateMachine::postEventFromOtherThread() assumed that 10,000 iterations of the event loop in a separate thread could always be completed successfully within the default QTRY_COMPARE timeout. This may be false if the CPU load is already high - such as when running other tests concurrently. Decrease the iteration count. Change-Id: I780523f73c0c16fa0b2ab3201b2b0affdebc198d Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro1
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
index 3b7c11b7d6..f62bbd938b 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
+++ b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
@@ -1,4 +1,5 @@
CONFIG += testcase
+CONFIG += parallel_test
TARGET = tst_qstatemachine
QT = core-private testlib gui widgets
SOURCES = tst_qstatemachine.cpp
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index 6a06a3fb5b..beca75b9fc 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -3753,7 +3753,7 @@ private Q_SLOTS:
void postEvent()
{
m_machine->postEvent(new QEvent(QEvent::User));
- if (++m_count < 10000)
+ if (++m_count < 1000)
QTimer::singleShot(0, this, SLOT(postEvent()));
else
quit();