aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-07-09 17:33:35 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-07-09 17:33:35 +0000
commitd9ca0564aa842c02b849b09f1715afbe7fab06e2 (patch)
treef6089fffc73b44ec685b7948081a3f8720282627
parent5043345aa49c679e107b9399a6ac2535df120470 (diff)
parent8e03b135014fef346a3563d93949d0f215a7ac21 (diff)
downloadtradefederation-d9ca0564aa842c02b849b09f1715afbe7fab06e2.tar.gz
Merge "Check FailureDescription for generating the report" am: a6a830d26d am: 0ac0e25031 am: 1a6c2457e4 am: 1db67ae9b6 am: 8e03b13501
Original change: https://android-review.googlesource.com/c/platform/tools/tradefederation/+/1357930 Change-Id: Id4ffdee22f2a5867e3104ba419ab879f7f6f29b8
-rw-r--r--src/com/android/tradefed/result/suite/FormattedGeneratorReporter.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/tradefed/result/suite/FormattedGeneratorReporter.java b/src/com/android/tradefed/result/suite/FormattedGeneratorReporter.java
index dbd521f02..9c8bd2288 100644
--- a/src/com/android/tradefed/result/suite/FormattedGeneratorReporter.java
+++ b/src/com/android/tradefed/result/suite/FormattedGeneratorReporter.java
@@ -17,7 +17,9 @@ package com.android.tradefed.result.suite;
import com.android.tradefed.config.IConfiguration;
import com.android.tradefed.config.IConfigurationReceiver;
+import com.android.tradefed.error.IHarnessException;
import com.android.tradefed.log.LogUtil.CLog;
+import com.android.tradefed.result.FailureDescription;
import com.android.tradefed.targetprep.TargetSetupError;
import com.android.tradefed.testtype.IRemoteTest;
import com.android.tradefed.testtype.suite.retry.ResultsPlayer;
@@ -68,11 +70,23 @@ public abstract class FormattedGeneratorReporter extends SuiteResultReporter
@Override
public void invocationFailed(Throwable cause) {
+ FailureDescription description =
+ FailureDescription.create(cause.getMessage()).setCause(cause);
+ if (cause instanceof IHarnessException) {
+ description.setErrorIdentifier(((IHarnessException) cause).getErrorId());
+ }
+ invocationFailed(description);
+ }
+
+ @Override
+ public void invocationFailed(FailureDescription failure) {
// Some exception indicate a harness level issue, the tests result cannot be trusted at
// that point so we should skip the reporting.
- if (cause instanceof TargetSetupError
- || cause instanceof RuntimeException
- || cause instanceof OutOfMemoryError) {
+ Throwable cause = failure.getCause();
+ if (cause != null
+ && (cause instanceof TargetSetupError
+ || cause instanceof RuntimeException
+ || cause instanceof OutOfMemoryError)) {
mTestHarnessError = cause;
}
super.invocationFailed(cause);