Merge "Saving bugreport for the first failed test." into udc-dev am: ff056355c2 am: 197459bd3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22826057 Change-Id: I571fde48322faeb7c45e84764d0654302d27de87 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class FailureWatcher extends TestWatcher {
|
||||
private static final String TAG = "FailureWatcher";
|
||||
private static boolean sSavedBugreport = false;
|
||||
final private UiDevice mDevice;
|
||||
private final LauncherInstrumentation mLauncher;
|
||||
|
||||
@@ -127,10 +128,10 @@ public class FailureWatcher extends TestWatcher {
|
||||
dumpCommand("logcat -d -s TestRunner", diagFile(description, "FilteredLogcat", "txt"));
|
||||
|
||||
// Dump bugreport
|
||||
final String systemAnomalyMessage = launcher.getSystemAnomalyMessage(false, false);
|
||||
if (systemAnomalyMessage != null) {
|
||||
Log.d(TAG, "Saving bugreport, system anomaly message: " + systemAnomalyMessage, e);
|
||||
if (!sSavedBugreport) {
|
||||
dumpCommand("bugreportz -s", diagFile(description, "Bugreport", "zip"));
|
||||
// Not saving bugreport for each failure for time and space economy.
|
||||
sSavedBugreport = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user