tst_QSharedPointer: raise the timeout for running qmake and makespec

We had 30s and 60s only, which isn'tenough for the Qt CI.

Task-number: QTBUG-69741
Change-Id: I00e04a465fcf4fc1a462fffd154782999e84ef8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Thiago Macieira 2018-08-03 16:09:54 -07:00
parent b3da7494ba
commit f8dba7ac01

View File

@ -53,6 +53,12 @@
# include <unistd.h>
#endif
enum {
QMakeTimeout = 300000, // 5 minutes
CompileTimeout = 600000, // 10 minutes
RunTimeout = 300000 // 5 minutes
};
static QString makespec()
{
static const char default_makespec[] = DEFAULT_MAKESPEC;
@ -143,7 +149,7 @@ namespace QTest {
bool prepareSourceCode(const QByteArray &body);
bool createProjectFile();
bool runQmake();
bool runMake(Target target);
bool runMake(Target target, int timeout);
bool commonSetup(const QByteArray &body);
};
@ -602,7 +608,7 @@ namespace QTest {
std_err += "qmake: ";
std_err += qmake.errorString().toLocal8Bit();
} else {
ok = qmake.waitForFinished();
ok = qmake.waitForFinished(QMakeTimeout);
exitCode = qmake.exitCode();
if (!ok)
QTest::ensureStopped(qmake);
@ -617,7 +623,7 @@ namespace QTest {
#endif // QT_CONFIG(process)
}
bool QExternalTestPrivate::runMake(Target target)
bool QExternalTestPrivate::runMake(Target target, int timeout)
{
#if !QT_CONFIG(process)
return false;
@ -670,7 +676,7 @@ namespace QTest {
}
make.closeWriteChannel();
bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : 60000);
bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : timeout);
if (!ok)
QTest::ensureStopped(make);
exitCode = make.exitCode();
@ -705,7 +711,7 @@ namespace QTest {
failedStage = QExternalTest::CompilationStage;
std_out += "\n### --- stdout from make (compilation) --- ###\n";
std_err += "\n### --- stderr from make (compilation) --- ###\n";
return runMake(Compile);
return runMake(Compile, CompileTimeout);
}
bool QExternalTestPrivate::tryLink(const QByteArray &body)
@ -717,7 +723,7 @@ namespace QTest {
failedStage = QExternalTest::LinkStage;
std_out += "\n### --- stdout from make (linking) --- ###\n";
std_err += "\n### --- stderr from make (linking) --- ###\n";
return runMake(Link);
return runMake(Link, CompileTimeout);
}
bool QExternalTestPrivate::tryRun(const QByteArray &body)
@ -729,7 +735,7 @@ namespace QTest {
failedStage = QExternalTest::RunStage;
std_out += "\n### --- stdout from process --- ###\n";
std_err += "\n### --- stderr from process --- ###\n";
return runMake(Run);
return runMake(Run, RunTimeout);
}
}
QT_END_NAMESPACE