diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-08-01 10:17:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-01 03:24:40 +0200 |
commit | 30eff894d9b31e0c800901e7334fed2401be0f1c (patch) | |
tree | 6da0d746b0b0f3ddab9fd91fff33e31d46308834 | |
parent | 9d16ae8d2ce5478f7387ec70c70be46e76c85796 (diff) |
Fixed tst_qprocess, tst_qtcpserver when crashing is slow
These tests assumed that a crashing program will always exit within
five seconds. This is not true in some situations. On our test macs,
enabling crash dumps can easily cause a process to take longer than
five seconds to crash.
Increased the timeout to 30 seconds.
Change-Id: Ifca240ac8d3da1346f33110653ac47de6ba2ab81
Reviewed-on: http://codereview.qt.nokia.com/2407
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
-rw-r--r-- | tests/auto/qprocess/tst_qprocess.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qtcpserver/tst_qtcpserver.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index f54dfa3f68..9873c3e357 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -335,7 +335,7 @@ void tst_QProcess::crashTest() QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError))); QSignalSpy spy2(process, SIGNAL(finished(int, QProcess::ExitStatus))); - QVERIFY(process->waitForFinished(5000)); + QVERIFY(process->waitForFinished(30000)); QCOMPARE(spy.count(), 1); QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed); @@ -372,7 +372,7 @@ void tst_QProcess::crashTest2() QObject::connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot())); - QTestEventLoop::instance().enterLoop(5); + QTestEventLoop::instance().enterLoop(30); if (QTestEventLoop::instance().timeout()) QFAIL("Failed to detect crash : operation timed out"); @@ -673,7 +673,7 @@ void tst_QProcess::exitStatus() for (int i = 0; i < processList.count(); ++i) { process->start(processList.at(i)); QVERIFY(process->waitForStarted(5000)); - QVERIFY(process->waitForFinished(5000)); + QVERIFY(process->waitForFinished(30000)); QCOMPARE(process->exitStatus(), exitStatus.at(i)); } diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index b566e5cebd..b72e61f374 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -575,7 +575,7 @@ void tst_QTcpServer::addressReusable() socket.connectToHost(QHostAddress::LocalHost, 49199); QVERIFY(socket.waitForConnected(5000)); - QVERIFY(process.waitForFinished(5000)); + QVERIFY(process.waitForFinished(30000)); // Give the system some time. QTest::qSleep(10); |