SshProcessInterface: Limit waiting for kill to finish

This is just a workaround for 9.0 and not a proper fix!

It looks like sometimes kill command may freeze. Don't blocking
wait for it for 30 seconds - limit this time to 2 seconds.

Do the same inside SimpleTargetRunner. Pretend the process
finished after 2 seconds, otherwise the SimpleTargetRunner
object gets leaked and we start receiving asserts from
ProcessLauncher about destructing it when still some processes
are being run.

Task-number: QTCREATORBUG-28072
Change-Id: I9766e7ff6f0c2abf2010686027702d30d32c4318
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-12-09 15:19:59 +01:00
parent 2596f39823
commit 218b19fe14
2 changed files with 9 additions and 3 deletions

View File

@@ -492,8 +492,10 @@ bool SshProcessInterface::runInShell(const CommandLine &command, const QByteArra
process.setCommand(cmd);
process.setWriteData(data);
process.start();
QTC_CHECK(process.waitForFinished()); // otherwise we may start producing killers for killers
return process.exitCode() == 0;
bool isFinished = process.waitForFinished(2000); // TODO: it may freeze on some devices
// otherwise we may start producing killers for killers
QTC_CHECK(isFinished);
return isFinished;
}
void SshProcessInterface::start()