From c19cd34a351b80c8b005492470357519e7baca9a Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Fri, 5 Mar 2021 09:30:34 +0000 Subject: [PATCH] Skipping printing AssumptionViolatedExceptions. Right now, if there are any failures along with the cases where we skip the test, we end up printing failure exception and all AssumptionViolatedExceptions which makes it hard to find the actual failures. Bug: 181686645 Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: Ib3f1622fc259ad4966789cfafdc54203c2559471 --- .../src/com/android/cts/net/HostsideNetworkTestCase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/cts/hostside/src/com/android/cts/net/HostsideNetworkTestCase.java b/tests/cts/hostside/src/com/android/cts/net/HostsideNetworkTestCase.java index ce203795f9..37420bfb1c 100644 --- a/tests/cts/hostside/src/com/android/cts/net/HostsideNetworkTestCase.java +++ b/tests/cts/hostside/src/com/android/cts/net/HostsideNetworkTestCase.java @@ -152,8 +152,10 @@ abstract class HostsideNetworkTestCase extends DeviceTestCase implements IAbiRec // build a meaningful error message StringBuilder errorBuilder = new StringBuilder("on-device tests failed:\n"); for (Map.Entry resultEntry : - result.getTestResults().entrySet()) { - if (!resultEntry.getValue().getStatus().equals(TestStatus.PASSED)) { + result.getTestResults().entrySet()) { + final TestStatus testStatus = resultEntry.getValue().getStatus(); + if (!TestStatus.PASSED.equals(testStatus) + && !TestStatus.ASSUMPTION_FAILURE.equals(testStatus)) { errorBuilder.append(resultEntry.getKey().toString()); errorBuilder.append(":\n"); errorBuilder.append(resultEntry.getValue().getStackTrace());