Ensure the parser fallback to string if cannot add
InvocationMetric can be concatenated if they are not
numbers.
Test: unit tests
Bug: 154262839
Change-Id: Iec4e0a367d540523a3db6b44f45393309f4acd04
diff --git a/src/com/android/tradefed/util/SubprocessTestResultsParser.java b/src/com/android/tradefed/util/SubprocessTestResultsParser.java
index db9f774..bc9d88f 100644
--- a/src/com/android/tradefed/util/SubprocessTestResultsParser.java
+++ b/src/com/android/tradefed/util/SubprocessTestResultsParser.java
@@ -576,8 +576,9 @@
try {
InvocationMetricLogger.addInvocationMetrics(key, Long.parseLong(val));
} catch (NumberFormatException e) {
- CLog.e("Key %s should have a number value, instead was: %s", key, val);
- CLog.e(e);
+ CLog.d("Key %s doesn't have a number value, was: %s.", key, val);
+ // If it's not a number then, let the string concatenate
+ InvocationMetricLogger.addInvocationMetrics(key, val);
}
} else {
InvocationMetricLogger.addInvocationMetrics(key, val);