forked from qt-creator/qt-creator
Process test: Adjust timeouts to minimize a chance for flakiness
The flakiness happened on mac inside recursiveBlockingProcess test. Change-Id: I4d461fcdae1ecbf29f89bfdb4ad7ba017724f14b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -245,7 +245,7 @@ int ProcessTestApp::RecursiveBlockingProcess::main()
|
||||
std::cout << s_leafProcessStarted << std::flush;
|
||||
while (true) {
|
||||
// TODO: make it configurable so that we could test the reaper timeout
|
||||
QThread::msleep(100);
|
||||
QThread::msleep(10);
|
||||
#ifndef Q_OS_WIN
|
||||
if (s_terminate.load()) {
|
||||
std::cout << s_leafProcessTerminated << std::flush;
|
||||
@@ -260,7 +260,7 @@ int ProcessTestApp::RecursiveBlockingProcess::main()
|
||||
process.setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
process.start();
|
||||
while (true) {
|
||||
if (process.waitForFinished(1000))
|
||||
if (process.waitForFinished(10))
|
||||
return 0;
|
||||
#ifndef Q_OS_WIN
|
||||
if (s_terminate.load()) {
|
||||
|
@@ -1370,14 +1370,17 @@ void tst_Process::recursiveBlockingProcess()
|
||||
subConfig.setupSubProcess(&process);
|
||||
process.start();
|
||||
QVERIFY(process.waitForStarted(1000));
|
||||
QVERIFY(process.waitForReadyRead(1000));
|
||||
// The readyRead() is generated from the innermost nested process, so it means
|
||||
// we need to give enough time for all nested processes to start their
|
||||
// process launchers successfully.
|
||||
QVERIFY(process.waitForReadyRead(2000));
|
||||
QCOMPARE(process.readAllRawStandardOutput(), s_leafProcessStarted);
|
||||
QCOMPARE(runningTestProcessCount(), recursionDepth);
|
||||
QVERIFY(!process.waitForFinished(1000));
|
||||
QVERIFY(!process.waitForFinished(10));
|
||||
process.terminate();
|
||||
QVERIFY(process.waitForReadyRead());
|
||||
QVERIFY(process.waitForReadyRead(1000));
|
||||
QCOMPARE(process.readAllRawStandardOutput(), s_leafProcessTerminated);
|
||||
QVERIFY(process.waitForFinished());
|
||||
QVERIFY(process.waitForFinished(1000));
|
||||
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
|
||||
QCOMPARE(process.exitCode(), s_crashCode);
|
||||
}
|
||||
|
Reference in New Issue
Block a user