AndroidTestRunner: try to pull results for few times
Try to pull result files for 3 times in case they fail, just to ensure less flakiness. Pick-to: 6.8 Change-Id: Id052fe2359d190fe87e304bbd22fc2096d50cadb Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
parent
29e2bada37
commit
488f30e4a0
@ -33,6 +33,7 @@ struct Options
|
|||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
bool skipAddInstallRoot = false;
|
bool skipAddInstallRoot = false;
|
||||||
int timeoutSecs = 600; // 10 minutes
|
int timeoutSecs = 600; // 10 minutes
|
||||||
|
int resultsPullRetries = 3;
|
||||||
QString buildPath;
|
QString buildPath;
|
||||||
QString adbCommand{"adb"_L1};
|
QString adbCommand{"adb"_L1};
|
||||||
QString serial;
|
QString serial;
|
||||||
@ -535,8 +536,18 @@ static bool pullResults()
|
|||||||
const QString catCmd = "cat files/output.%1 2> /dev/null"_L1.arg(outSuffix);
|
const QString catCmd = "cat files/output.%1 2> /dev/null"_L1.arg(outSuffix);
|
||||||
const QStringList fullCatArgs = { "shell"_L1, runCommandAsUserArgs(catCmd) };
|
const QStringList fullCatArgs = { "shell"_L1, runCommandAsUserArgs(catCmd) };
|
||||||
|
|
||||||
|
bool catSuccess = false;
|
||||||
QByteArray output;
|
QByteArray output;
|
||||||
if (!execAdbCommand(fullCatArgs, &output, false)) {
|
|
||||||
|
for (int i = 1; i <= g_options.resultsPullRetries; ++i) {
|
||||||
|
catSuccess = execAdbCommand(fullCatArgs, &output, false);
|
||||||
|
if (!catSuccess)
|
||||||
|
continue;
|
||||||
|
else if (!output.isEmpty())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!catSuccess) {
|
||||||
qCritical() << "Error: failed to retrieve the test's output.%1 file."_L1.arg(outSuffix);
|
qCritical() << "Error: failed to retrieve the test's output.%1 file."_L1.arg(outSuffix);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user