From 30eff894d9b31e0c800901e7334fed2401be0f1c Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 1 Aug 2011 10:17:51 +1000 Subject: 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 --- tests/auto/qprocess/tst_qprocess.cpp | 6 +++--- 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(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); -- cgit v1.2.3