Fixed tst_qprocess, tst_qtcpserver when crashing is slow
authorRohan McGovern <rohan.mcgovern@nokia.com>
Mon, 1 Aug 2011 00:17:51 +0000 (10:17 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 1 Aug 2011 01:24:40 +0000 (03:24 +0200)
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>
tests/auto/qprocess/tst_qprocess.cpp
tests/auto/qtcpserver/tst_qtcpserver.cpp

index f54dfa3..9873c3e 100644 (file)
@@ -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));
     }
index b566e5c..b72e61f 100644 (file)
@@ -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);