AndroidTestRunner: make adb logcat -b crash non blocking
We only need a snapshot of the crash logs, so pass -d to make the call
non-blocking, this means we we can check right away for start/finish
of that process. This would also, the error:
Error: failed to run ndk-stack command.
agent:2024/10/21 16:31:42 build.go:404: QProcess: Destroyed while
process ("/opt/android/sdk/platform-tools/adb") is still running.
Change-Id: I2314d0b9567865934c2aa8f6d40ace2b4288ebb2
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 2d3334a87955cd54bb47b57a25af2ed0ce6f3a69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bb10
parent
80eba25971
commit
8a3753cda2
|
|
@ -638,7 +638,7 @@ void printLogcatCrashBuffer(const QString &formattedTime)
|
|||
ndkStackProcess.start(g_options.ndkStackPath, { "-sym"_L1, libsPath });
|
||||
}
|
||||
|
||||
QStringList adbCrashArgs = { "logcat"_L1, "-b"_L1, "crash"_L1, "-t"_L1, formattedTime };
|
||||
QStringList adbCrashArgs = {"logcat"_L1, "-d"_L1, "-b"_L1, "crash"_L1, "-t"_L1, formattedTime};
|
||||
if (!g_options.serial.isEmpty())
|
||||
adbCrashArgs = QStringList{"-s"_L1 + g_options.serial} + adbCrashArgs;
|
||||
|
||||
|
|
@ -649,19 +649,21 @@ void printLogcatCrashBuffer(const QString &formattedTime)
|
|||
return;
|
||||
}
|
||||
|
||||
if (useNdkStack && !ndkStackProcess.waitForStarted()) {
|
||||
qCritical() << "Error: failed to run ndk-stack command.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!adbCrashProcess.waitForFinished()) {
|
||||
qCritical() << "Error: adb command timed out.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (useNdkStack && !ndkStackProcess.waitForFinished()) {
|
||||
qCritical() << "Error: ndk-stack command timed out.";
|
||||
return;
|
||||
if (useNdkStack) {
|
||||
if (!ndkStackProcess.waitForStarted()) {
|
||||
qCritical() << "Error: failed to run ndk-stack command.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ndkStackProcess.waitForFinished()) {
|
||||
qCritical() << "Error: ndk-stack command timed out.";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const QByteArray crash = useNdkStack ? ndkStackProcess.readAllStandardOutput()
|
||||
|
|
|
|||
Loading…
Reference in New Issue